Popup Builder – Responsive WordPress Pop up - Version 2.0.5

Version Description

Download this release

Release Info

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

Code changes from version 2.0.4 to 2.0.5

Files changed (50) hide show
  1. classes/PopupInstaller.php +79 -203
  2. classes/SGPopup.php +28 -28
  3. files/main_html_section.php +0 -19
  4. files/main_image_section.php +0 -9
  5. files/main_section/html.php +15 -0
  6. files/main_section/image.php +10 -0
  7. files/options_html_section.php +0 -24
  8. files/options_image_section.php +0 -24
  9. files/options_section/html.php +25 -0
  10. files/options_section/image.php +25 -0
  11. files/sg_popup_ajax.php +13 -23
  12. files/sg_popup_create.php +21 -36
  13. files/sg_popup_create_new.php +384 -240
  14. files/sg_popup_main.php +73 -77
  15. files/sg_popup_media_button.php +89 -0
  16. files/sg_popup_media_buuton.php +0 -76
  17. files/sg_popup_page_selection.php +27 -35
  18. files/sg_popup_pro.php +10 -0
  19. files/sg_popup_save.php +190 -0
  20. files/sg_popup_savePopupFrom.php +0 -166
  21. img/AgeRestriction.png +0 -0
  22. img/Countdown.png +0 -0
  23. img/default-image.png +0 -0
  24. img/down_arrow-2x.gif +0 -0
  25. img/info.png +0 -0
  26. img/pp_Icon.png +0 -0
  27. img/preview-eye.png +0 -0
  28. img/socialPopup.png +0 -0
  29. img/theme1.jpg +0 -0
  30. img/theme2.jpg +0 -0
  31. img/theme3.jpg +0 -0
  32. img/theme4.jpg +0 -0
  33. img/theme5.jpg +0 -0
  34. img/wpspin_light.gif +0 -0
  35. javascript/jquery.colorbox-min.js +0 -0
  36. javascript/sg_popup_backend.js +1 -1
  37. javascript/sg_popup_frontend.js +251 -216
  38. javascript/sg_popup_javascript.php +48 -51
  39. javascript/sg_popup_rangeslider.js +0 -0
  40. popup-builder.php +107 -55
  41. readme.txt +20 -0
  42. style/animate.css +0 -0
  43. style/sg_popup_rangeslider.css +0 -0
  44. style/sg_popup_style.css +419 -284
  45. style/sg_popup_style.php +32 -33
  46. style/sgcolorbox/colorbox1.css +0 -0
  47. style/sgcolorbox/colorbox2.css +0 -0
  48. style/sgcolorbox/colorbox3.css +0 -0
  49. style/sgcolorbox/colorbox4.css +0 -0
  50. style/sgcolorbox/colorbox5.css +0 -0
classes/PopupInstaller.php CHANGED
@@ -1,204 +1,80 @@
1
- <?php
2
- class PopupInstaller {
3
- public static function creteTable() {
4
- global $wpdb;
5
- $sg_popup_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix ."sg_popup (
6
- `id` int(11) NOT NULL AUTO_INCREMENT,
7
- `type` varchar(255) NOT NULL,
8
- `title` varchar(255) NOT NULL,
9
- `options` text NOT NULL,
10
- PRIMARY KEY (id)
11
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
12
- $sg_popup_image_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix ."sg_image_popup (
13
- `id` int(11) NOT NULL,
14
- `url` varchar(255) NOT NULL
15
- ) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8;";
16
- $sg_popup_html_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix ."sg_html_popup (
17
- `id` int(11) NOT NULL,
18
- `content` text NOT NULL
19
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
20
-
21
-
22
- $wpdb->query($sg_popup_base);
23
- $wpdb->query($sg_popup_image_base);
24
- $wpdb->query($sg_popup_html_base);
25
- }
26
- public static function createTables($bolgs_id) {
27
- global $wpdb;
28
- update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
29
- $sg_popup_net_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$bolgs_id."_sg_popup (
30
- `id` int(11) NOT NULL AUTO_INCREMENT,
31
- `type` varchar(255) NOT NULL,
32
- `title` varchar(255) NOT NULL,
33
- `options` text NOT NULL,
34
- PRIMARY KEY (id)
35
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
36
- $sg_popup_image_net_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$bolgs_id."_sg_image_popup (
37
- `id` int(11) NOT NULL,
38
- `url` varchar(255) NOT NULL
39
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
40
- $sg_popup_html_net_base = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$bolgs_id."_sg_html_popup (
41
- `id` int(11) NOT NULL,
42
- `content` varchar(255) NOT NULL
43
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
44
-
45
-
46
- $wpdb->query($sg_popup_net_base);
47
- $wpdb->query($sg_popup_image_net_base);
48
- $wpdb->query($sg_popup_html_net_base);
49
- }
50
-
51
- public static function install() {
52
- $obj = new self();
53
-
54
- $obj->creteTable();
55
- if(is_multisite() ) {
56
-
57
- $stites = wp_get_sites();
58
- foreach($stites as $site) {
59
- $bolgs_id = $site['blog_id'];
60
- global $wpdb;
61
- $obj->createTables($bolgs_id);
62
- }
63
- }
64
- }
65
- public static function uninstallTabele() {
66
- global $wpdb;
67
- $delete = "DELETE FROM ".$wpdb->prefix."postmeta WHERE meta_key = 'sg_promotional_popup' ";
68
- $wpdb->query($delete);
69
- $popup_table = $wpdb->prefix."sg_popup";
70
- $popup_sql = "DROP TABLE ". $popup_table;
71
- $popup_image_table = $wpdb->prefix."sg_image_popup";
72
- $popup_image_sql = "DROP TABLE ". $popup_image_table;
73
- $popup_html_table = $wpdb->prefix."sg_html_popup";
74
- $popup_html_sql = "DROP TABLE ". $popup_html_table;
75
-
76
- $wpdb->query($popup_sql);
77
- $wpdb->query($popup_image_sql);
78
- $wpdb->query($popup_html_sql);
79
-
80
- }
81
- public static function uninstallTabeles($bolgs_id) {
82
- global $wpdb;
83
- $delete = "DELETE FROM ".$wpdb->prefix.$bolgs_id."_postmeta WHERE meta_key = 'sg_promotional_popup' ";
84
- $wpdb->query($delete);
85
- $popup_net_table = $wpdb->prefix.$bolgs_id."_sg_popup";
86
- $popup_net_sql = "DROP TABLE ". $popup_net_table;
87
- $popup_image_net_table = $wpdb->prefix.$bolgs_id."_sg_image_popup";
88
- $popup_image_net_sql = "DROP TABLE ". $popup_image_net_table;
89
- $popup_html_net_table = $wpdb->prefix.$bolgs_id."_sg_html_popup";
90
- $popup_html_net_sql = "DROP TABLE ". $popup_html_net_table;
91
-
92
- $wpdb->query($popup_net_sql);
93
- $wpdb->query($popup_image_net_sql);
94
- $wpdb->query($popup_html_net_sql);
95
-
96
- }
97
- public static function uninstall() {
98
- global $wpdb; //required global declaration of WP variable
99
-
100
- $obj = new self();
101
-
102
- $obj->uninstallTabele();
103
- if(is_multisite() ) {
104
-
105
- $stites = wp_get_sites();
106
- foreach($stites as $site) {
107
- $bolgs_id = $site['blog_id'];
108
- global $wpdb;
109
- $obj->uninstallTabeles($bolgs_id);
110
- }
111
- }
112
-
113
- }
114
- public function covertPromotionalTable() {
115
- global $wpdb;
116
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_promotional_popup", array());
117
- $popups = $wpdb->get_results($st, ARRAY_A);
118
- foreach ($popups as $popup) {
119
- $options = $popup['options'];
120
- $jsonData = json_decode($options);
121
- $title = $jsonData->title;
122
- $type = strtolower($popup['content']);
123
- $mainsql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
124
- $resmain = $wpdb->query($mainsql);
125
- $id = $popup['id'];
126
- $sgHtmlPopup = $popup['html'];
127
- $sgImagePopup = $popup['image'];
128
- $sgIframePopup = $popup['iframe'];
129
- $sgShortCodePopup = $popup['shortCode'];
130
- switch ( $popup['content']) {
131
- case 'iframe':
132
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_iframe_popup (id, url) VALUES (%d,%s)",$id,$sgIframePopup);
133
- $res = $wpdb->query($sql);
134
- break;
135
- case "Image":
136
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_image_popup (id, url) VALUES (%d,%s)",$id,$sgImagePopup);
137
- $res = $wpdb->query($sql);
138
- break;
139
- case "html":
140
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_html_popup (id, content) VALUES (%d,%s)",$id,$sgHtmlPopup);
141
- $res = $wpdb->query($sql);
142
- break;
143
- case "shortCode":
144
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_shortCode_popup (id, url) VALUES (%d,%s)",$id,$sgShortCodePopup);
145
- $res = $wpdb->query($sql);
146
- break;
147
- }
148
- }
149
- }
150
-
151
- public function covertPromotionalTables($bolgs_id) {
152
- global $wpdb;
153
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix.$bolgs_id."_sg_promotional_popup", array());
154
- $popups = $wpdb->get_results($st, ARRAY_A);
155
- foreach ($popups as $popup) {
156
- $options = $popup['options'];
157
- $jsonData = json_decode($options);
158
- $title = $jsonData->title;
159
- $type = strtolower($popup['content']);
160
- $mainsqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
161
- $resmain = $wpdb->query($mainsqlnet);
162
- $id = $popup['id'];
163
- $sgHtmlPopup = $popup['html'];
164
- $sgImagePopup = $popup['image'];
165
- $sgIframePopup = $popup['iframe'];
166
- $sgShortCodePopup = $popup['shortCode'];
167
- switch ( $popup['content']) {
168
- case 'iframe':
169
- $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_iframe_popup (id, url) VALUES (%d,%s)",$id,$sgIframePopup);
170
- $res = $wpdb->query($sqlnet);
171
- break;
172
- case "Image":
173
- $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_image_popup (id, url) VALUES (%d,%s)",$id,$sgImagePopup);
174
- $res = $wpdb->query($sqlnet);
175
- break;
176
- case "html":
177
- $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_html_popup (id, content) VALUES (%d,%s)",$id,$sgHtmlPopup);
178
- $res = $wpdb->query($sqlnet);
179
- break;
180
- case "shortCode":
181
- $sqlnet = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix.$bolgs_id."_sg_shortCode_popup (id, url) VALUES (%d,%s)",$id,$sgShortCodePopup);
182
- $res = $wpdb->query($sqlnet);
183
- break;
184
- }
185
- }
186
- }
187
- public static function convert() {
188
- global $wpdb;
189
-
190
- $obj = new self();
191
-
192
- $obj->covertPromotionalTable();
193
-
194
- if(is_multisite()) {
195
- $stites = wp_get_sites();
196
- foreach($stites as $site) {
197
- $bolgs_id = $site['blog_id'];
198
- global $wpdb;
199
-
200
- $obj->covertPromotionalTables($bolgs_id);
201
- }
202
- }
203
- }
204
  }
1
+ <?php
2
+ class PopupInstaller
3
+ {
4
+ public static function createTables($blogsId)
5
+ {
6
+ global $wpdb;
7
+ update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
8
+ $sgPopupBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId."sg_popup (
9
+ `id` int(11) NOT NULL AUTO_INCREMENT,
10
+ `type` varchar(255) NOT NULL,
11
+ `title` varchar(255) NOT NULL,
12
+ `options` text NOT NULL,
13
+ PRIMARY KEY (id)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
15
+ $sgPopupImageBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId."sg_image_popup (
16
+ `id` int(11) NOT NULL,
17
+ `url` varchar(255) NOT NULL
18
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
19
+ $sgPopupHtmlBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId."sg_html_popup (
20
+ `id` int(11) NOT NULL,
21
+ `content` text NOT NULL
22
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
23
+
24
+
25
+ $wpdb->query($sgPopupBase);
26
+ $wpdb->query($sgPopupImageBase);
27
+ $wpdb->query($sgPopupHtmlBase);
28
+ }
29
+
30
+ public static function install()
31
+ {
32
+ $obj = new self();
33
+ $obj->createTables("");
34
+
35
+ if(is_multisite()) {
36
+ $sites = wp_get_sites();
37
+ foreach($sites as $site) {
38
+ $blogsId = $site['blog_id']."_";
39
+ global $wpdb;
40
+ $obj->createTables($blogsId);
41
+ }
42
+ }
43
+ }
44
+
45
+ public static function uninstallTables($blogsId)
46
+ {
47
+ global $wpdb;
48
+ $delete = "DELETE FROM ".$wpdb->prefix.$blogsId."postmeta WHERE meta_key = 'sg_promotional_popup' ";
49
+ $wpdb->query($delete);
50
+
51
+ $popupTable = $wpdb->prefix.$blogsId."sg_popup";
52
+ $popupSql = "DROP TABLE ". $popupTable;
53
+
54
+ $popupImageTable = $wpdb->prefix.$blogsId."sg_image_popup";
55
+ $popupImageSql = "DROP TABLE ". $popupImageTable;
56
+
57
+ $popupHtmlTable = $wpdb->prefix.$blogsId."sg_html_popup";
58
+ $popupHtmlSql = "DROP TABLE ". $popupHtmlTable;
59
+
60
+ $wpdb->query($popupSql);
61
+ $wpdb->query($popupImageSql);
62
+ $wpdb->query($popupHtmlSql);
63
+
64
+ }
65
+
66
+ public static function uninstall() {
67
+ global $wpdb;
68
+ $obj = new self();
69
+ $obj->uninstallTables("");
70
+
71
+ if(is_multisite()) {
72
+ $stites = wp_get_sites();
73
+ foreach($stites as $site) {
74
+ $blogsId = $site['blog_id']."_";
75
+ global $wpdb;
76
+ $obj->uninstallTables($blogsId);
77
+ }
78
+ }
79
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
classes/SGPopup.php CHANGED
@@ -13,7 +13,7 @@ abstract class SGPopup {
13
  protected $initialHeight;
14
  protected $options;
15
  public static $registeredScripts = false;
16
-
17
  public function setType($type){
18
  $this->type = $type;
19
  }
@@ -76,12 +76,12 @@ abstract class SGPopup {
76
  }
77
  public function setOptions($options) {
78
  $this->options = $options;
79
- }
80
  public function getOptions() {
81
  return $this->options;
82
  }
83
  public static function findById($id) {
84
-
85
  global $wpdb;
86
  $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup WHERE id = %d",$id);
87
  $arr = $wpdb->get_row($st,ARRAY_A);
@@ -95,38 +95,38 @@ abstract class SGPopup {
95
  abstract protected function getExtraRenderOptions();
96
 
97
  private static function popupObjectFromArray($arr, $obj = null) {
98
-
99
  $jsonData = json_decode($arr['options'], true);
100
 
101
- $type = notNull($arr['type']);
102
-
103
  if ($obj===null) {
104
  $className = "SG".ucfirst(strtolower($type)).'Popup';
105
  require_once(dirname(__FILE__).'/'.$className.'.php');
106
  $obj = new $className();
107
  }
108
 
109
- $obj->setType(notNull($type));
110
- $obj->setTitle(notNull($arr['title']));
111
  if (@$arr['id']) $obj->setId($arr['id']);
112
- $obj->setWidth(notNull(@$jsonData['width']));
113
- $obj->setHeight(notNull(@$jsonData['height']));
114
- $obj->setDelay(notNull(@$jsonData['delay']));
115
- $obj->setEffectDuration(notNull(@$jsonData['duration']));
116
- $obj->setEffect(notNull($jsonData['effect']));
117
- $obj->setInitialWidth(notNull(@$jsonData['initialWidth']));
118
- $obj->setInitialHeight(notNull(@$jsonData['initialHeight']));
119
- $obj->setOptions(notNull($arr['options']));
120
 
121
  if (@$arr['id']) $obj->setCustomOptions($arr['id']);
122
 
123
  return $obj;
124
  }
125
-
126
- public static function create($data, $obj)
127
  {
128
  self::popupObjectFromArray($data, $obj);
129
- return $obj->save();
130
  }
131
  public function save($data = array()) {
132
 
@@ -136,18 +136,18 @@ abstract class SGPopup {
136
  $options = $this->getOptions();
137
 
138
  global $wpdb;
139
-
140
  if($id == '') {
141
- $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
142
  $res = $wpdb->query($sql);
143
-
144
 
145
  if ($res) {
146
  $id = $wpdb->insert_id;
147
  $this->setId($id);
148
  }
149
  return $res;
150
-
151
  }
152
  else {
153
  $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup SET type=%s,title=%s,options=%s WHERE id=%d",$type,$title,$options,$id);
@@ -209,12 +209,12 @@ abstract class SGPopup {
209
  )
210
  );
211
  }
212
-
213
  public static function setPopupForPost($post_id, $popupId) {
214
  update_post_meta($post_id, 'wp_sg_popup' , $popupId);
215
  }
216
-
217
-
218
  public function render() {
219
  $parentOption = array('id'=>$this->getId(),'title'=>$this->getTitle(),'type'=>$this->getType(),'effect'=>$this->getEffect(),'width',$this->getWidth(),'height'=>$this->getHeight(),'delay'=>$this->getDelay(),'duration'=>$this->getEffectDuration(),'initialWidth',$this->getInitialWidth(),'initialHeight'=>$this->getInitialHeight());
220
  $getexrArray = $this->getExtraRenderOptions();
@@ -239,9 +239,9 @@ abstract class SGPopup {
239
  }
240
  return $id;
241
  }
242
-
243
  }
244
 
245
- function notNull($param) {
246
  return ($param===null?'':$param);
247
  }
13
  protected $initialHeight;
14
  protected $options;
15
  public static $registeredScripts = false;
16
+
17
  public function setType($type){
18
  $this->type = $type;
19
  }
76
  }
77
  public function setOptions($options) {
78
  $this->options = $options;
79
+ }
80
  public function getOptions() {
81
  return $this->options;
82
  }
83
  public static function findById($id) {
84
+
85
  global $wpdb;
86
  $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup WHERE id = %d",$id);
87
  $arr = $wpdb->get_row($st,ARRAY_A);
95
  abstract protected function getExtraRenderOptions();
96
 
97
  private static function popupObjectFromArray($arr, $obj = null) {
98
+
99
  $jsonData = json_decode($arr['options'], true);
100
 
101
+ $type = sgSafeStr($arr['type']);
102
+
103
  if ($obj===null) {
104
  $className = "SG".ucfirst(strtolower($type)).'Popup';
105
  require_once(dirname(__FILE__).'/'.$className.'.php');
106
  $obj = new $className();
107
  }
108
 
109
+ $obj->setType(sgSafeStr($type));
110
+ $obj->setTitle(sgSafeStr($arr['title']));
111
  if (@$arr['id']) $obj->setId($arr['id']);
112
+ $obj->setWidth(sgSafeStr(@$jsonData['width']));
113
+ $obj->setHeight(sgSafeStr(@$jsonData['height']));
114
+ $obj->setDelay(sgSafeStr(@$jsonData['delay']));
115
+ $obj->setEffectDuration(sgSafeStr(@$jsonData['duration']));
116
+ $obj->setEffect(sgSafeStr($jsonData['effect']));
117
+ $obj->setInitialWidth(sgSafeStr(@$jsonData['initialWidth']));
118
+ $obj->setInitialHeight(sgSafeStr(@$jsonData['initialHeight']));
119
+ $obj->setOptions(sgSafeStr($arr['options']));
120
 
121
  if (@$arr['id']) $obj->setCustomOptions($arr['id']);
122
 
123
  return $obj;
124
  }
125
+
126
+ public static function create($data, $obj)
127
  {
128
  self::popupObjectFromArray($data, $obj);
129
+ return $obj->save();
130
  }
131
  public function save($data = array()) {
132
 
136
  $options = $this->getOptions();
137
 
138
  global $wpdb;
139
+
140
  if($id == '') {
141
+ $sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup(type,title,options) VALUES (%s,%s,%s)",$type,$title,$options);
142
  $res = $wpdb->query($sql);
143
+
144
 
145
  if ($res) {
146
  $id = $wpdb->insert_id;
147
  $this->setId($id);
148
  }
149
  return $res;
150
+
151
  }
152
  else {
153
  $sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup SET type=%s,title=%s,options=%s WHERE id=%d",$type,$title,$options,$id);
209
  )
210
  );
211
  }
212
+
213
  public static function setPopupForPost($post_id, $popupId) {
214
  update_post_meta($post_id, 'wp_sg_popup' , $popupId);
215
  }
216
+
217
+
218
  public function render() {
219
  $parentOption = array('id'=>$this->getId(),'title'=>$this->getTitle(),'type'=>$this->getType(),'effect'=>$this->getEffect(),'width',$this->getWidth(),'height'=>$this->getHeight(),'delay'=>$this->getDelay(),'duration'=>$this->getEffectDuration(),'initialWidth',$this->getInitialWidth(),'initialHeight'=>$this->getInitialHeight());
220
  $getexrArray = $this->getExtraRenderOptions();
239
  }
240
  return $id;
241
  }
242
+
243
  }
244
 
245
+ function sgSafeStr ($param) {
246
  return ($param===null?'':$param);
247
  }
files/main_html_section.php DELETED
@@ -1,19 +0,0 @@
1
- <div class="htmlType">
2
- <?php
3
- $content = wp_kses_post($sgPopupDataHtml);
4
- $editor_id = 'sg_popup_html';
5
- $settings = array(
6
- 'teeny' => true,
7
- 'tinymce' => array(
8
- 'width' => '100%',
9
- ),
10
- 'textarea_rows' => '6',
11
-
12
- 'editor_css' => '<style> #mceu_27-body{
13
- width: 100%;
14
- } </style>',
15
- 'media_buttons' => true
16
- );
17
- wp_editor( $content, $editor_id, $settings );
18
- ?>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/main_image_section.php DELETED
@@ -1,9 +0,0 @@
1
- <div class="imagetype">
2
- <h1 class="imageHeadline">Please choose your picture</h1>
3
- <div class="imageUploderWrapper">
4
- <input class='sameWidthinputs' id="upload_image" type="text" size="36" name="ad_image" value="<?php echo esc_attr($sgPopupDataImage); ?>" /> <input id="upload_image_button" class="button sameWidthinputs" type="button" value="Select image" />
5
- </div>
6
- <div class="ShowSelectedImage">
7
- <span class="NoImage">(No image selected)</span>
8
- </div>
9
- </div>
 
 
 
 
 
 
 
 
 
files/main_section/html.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="sg-wp-editor-container">
2
+ <?php
3
+ $content = @$sgPopupDataHtml;
4
+ $editorId = 'sg_popup_html';
5
+ $settings = array(
6
+ 'teeny' => true,
7
+ 'tinymce' => array(
8
+ 'width' => '100%',
9
+ ),
10
+ 'textarea_rows' => '6',
11
+ 'media_buttons' => true
12
+ );
13
+ wp_editor($content, $editorId, $settings);
14
+ ?>
15
+ </div>
files/main_section/image.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <div class="sg-wp-editor-container">
2
+ <h1 class="image-popup-headline">Please choose your picture</h1>
3
+ <div class="image-uploader-wrapper">
4
+ <input class="input-width-static" id="js-upload-image" type="text" size="36" name="ad_image" value="<?php echo esc_attr($sgPopupDataImage); ?>">
5
+ <input id="js-upload-image-button" class="button" type="button" value="Select image">
6
+ </div>
7
+ <div class="show-image-contenier">
8
+ <span class="no-image">(No image selected)</span>
9
+ </div>
10
+ </div>
files/options_html_section.php DELETED
@@ -1,24 +0,0 @@
1
- <div id="sepectialOptons">
2
- <div id="post-body" class="metabox-holder columns-2">
3
- <div id="postbox-container-2" class="postbox-container">
4
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
- <div class="postbox popupBuilder_spetial_postbox sgSameWidthPostBox" style="display: block;">
6
- <div class="handlediv spectialTitle" title="Click to toggle"><br></div>
7
- <h3 class="hndle ui-sortable-handle spectialTitle" style="cursor: pointer">
8
- <span><?php
9
- global $POPUP_TITLES;
10
- $popupTypeTitle = $POPUP_TITLES[$popupType];
11
- echo $popupTypeTitle;?> options
12
- </span>
13
- </h3>
14
- <div class="inside">
15
- <div class="specialOptionsContent">
16
- <p>No options</p>
17
- </div>
18
- </div>
19
- </div>
20
-
21
- </div>
22
- </div>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/options_image_section.php DELETED
@@ -1,24 +0,0 @@
1
- <div id="sepectialOptons">
2
- <div id="post-body" class="metabox-holder columns-2">
3
- <div id="postbox-container-2" class="postbox-container">
4
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
- <div class="postbox popupBuilder_spetial_postbox sgSameWidthPostBox" style="display: block;">
6
- <div class="handlediv spectialTitle" title="Click to toggle"><br></div>
7
- <h3 class="hndle ui-sortable-handle spectialTitle" style="cursor: pointer">
8
- <span><?php
9
- global $POPUP_TITLES;
10
- $popupTypeTitle = $POPUP_TITLES[$popupType];
11
- echo $popupTypeTitle;?> options
12
- </span>
13
- </h3>
14
- <div class="inside">
15
- <div class="specialOptionsContent">
16
- <p>No options</p>
17
- </div>
18
- </div>
19
- </div>
20
-
21
- </div>
22
- </div>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/options_section/html.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="special-options">
2
+ <div id="post-body" class="metabox-holder columns-2">
3
+ <div id="postbox-container-2" class="postbox-container">
4
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
+ <div class="postbox popup-builder-special-postbox">
6
+ <div class="handlediv js-special-title" title="Click to toggle"><br></div>
7
+ <h3 class="hndle ui-sortable-handle js-special-title">
8
+ <span>
9
+ <?php
10
+ global $POPUP_TITLES;
11
+ $popupTypeTitle = $POPUP_TITLES[$popupType];
12
+ echo $popupTypeTitle." <span>options</span>";
13
+ ?>
14
+ </span>
15
+ </h3>
16
+ <div class="inside">
17
+ <div class="special-options-content">
18
+ <p>No options</p>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
files/options_section/image.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="special-options">
2
+ <div id="post-body" class="metabox-holder columns-2">
3
+ <div id="postbox-container-2" class="postbox-container">
4
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
5
+ <div class="postbox popup-builder-special-postbox">
6
+ <div class="handlediv js-special-title" title="Click to toggle"><br></div>
7
+ <h3 class="hndle ui-sortable-handle js-special-title">
8
+ <span>
9
+ <?php
10
+ global $POPUP_TITLES;
11
+ $popupTypeTitle = $POPUP_TITLES[$popupType];
12
+ echo $popupTypeTitle." <span>options</span>";
13
+ ?>
14
+ </span>
15
+ </h3>
16
+ <div class="inside">
17
+ <div class="special-options-content">
18
+ <p>No options</p>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
files/sg_popup_ajax.php CHANGED
@@ -1,23 +1,13 @@
1
- <?php
2
- // save ajax
3
-
4
-
5
- /*
6
- * delete ajax opretion
7
-
8
- */
9
- function sg_popup_delete() {
10
-
11
- $id = (int)$_POST['popup_id'];
12
- if (!$id) return;
13
- require_once( SG_APP_POPUP_CLASSES .'/SGPopup.php');
14
- SGPopup::delete($id);
15
- }
16
- add_action('wp_ajax_delete_promotional_popup', 'sg_popup_delete');
17
-
18
- function sg_popup_preview() {
19
- sgFindPopupData($_POST['postId']);
20
- die();
21
- }
22
- add_action('wp_ajax_get_popup_preview', 'sg_popup_preview');
23
-
1
+ <?php
2
+
3
+ function sgPopupDelete()
4
+ {
5
+ $id = (int)@$_POST['popup_id'];
6
+ if (!$id) {
7
+ return;
8
+ }
9
+ require_once(SG_APP_POPUP_CLASSES.'/SGPopup.php');
10
+ SGPopup::delete($id);
11
+ }
12
+
13
+ add_action('wp_ajax_delete_popup', 'sgPopupDelete');
 
 
 
 
 
 
 
 
 
 
files/sg_popup_create.php CHANGED
@@ -1,54 +1,39 @@
1
  <h2>Add New Popup</h2>
2
- <div class="popupsWrapper">
3
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=image">
4
- <div class="popupsDiv imagePopup">
5
-
6
  </div>
7
  </a>
8
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=html">
9
- <div class="popupsDiv htmlPopup">
10
  </div>
11
  </a>
12
- <?php if(SG_POPUP_PRO) { ?>
13
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=iframe">
14
- <div class="popupsDiv iframePopup">
15
  </div>
16
  </a>
17
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=shortcode">
18
- <div class="popupsDiv shortcodePopup">
19
  </div>
20
  </a>
21
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=video">
22
- <div class="popupsDiv videoPopup">
23
  </div>
24
  </a>
25
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=ageRestriction">
26
- <div class="popupsDiv ageRestriction">
 
 
27
  </div>
28
  </a>
29
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=countdown">
30
- <div class="popupsDiv countdown">
31
  </div>
32
  </a>
33
- <a class="createPopupLink" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=social">
34
- <div class="popupsDiv sgSocial">
35
  </div>
36
  </a>
37
- <?php } ?>
38
- <?php
39
- if(SG_POPUP_PRO == 0) { ?>
40
- <a class="createPopupLink" href="<?php echo SG_POPUP_PRO_URL;?>" target=\"_blank\"">
41
- <div class="popupsDiv iframePopupPro">
42
- </div>
43
- </a>
44
- <a class="createPopupLink" href="<?php echo SG_POPUP_PRO_URL;?>" target=\"_blank\"">
45
- <div class="popupsDiv shortcodePopupPro">
46
- </div>
47
- </a>
48
- <a class="createPopupLink" href="<?php echo SG_POPUP_PRO_URL;?>" target=\"_blank\">
49
- <div class="popupsDiv videoPopupPro">
50
- </div>
51
- </a>
52
- <?php }
53
- ?>
54
  </div>
1
  <h2>Add New Popup</h2>
2
+ <div class="popups-wrapper">
3
+ <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=image">
4
+ <div class="popups-div image-popup">
 
5
  </div>
6
  </a>
7
+ <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=html">
8
+ <div class="popups-div html-popup">
9
  </div>
10
  </a>
11
+ <?php if(SG_POPUP_PRO): ?>
12
+ <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=iframe">
13
+ <div class="popups-div iframe-popup">
14
  </div>
15
  </a>
16
+ <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=shortcode">
17
+ <div class="popups-div shortcode-popup">
18
  </div>
19
  </a>
20
+ <a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=video">
21
+ <div class="popups-div video-popup">
22
  </div>
23
  </a>
24
+ <?php endif; ?>
25
+ <?php if (SG_POPUP_PRO == 0): ?>
26
+ <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
27
+ <div class="popups-div iframe-popup-pro">
28
  </div>
29
  </a>
30
+ <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
31
+ <div class="popups-div shortcode-popup-pro">
32
  </div>
33
  </a>
34
+ <a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
35
+ <div class="popups-div video-popup-pro">
36
  </div>
37
  </a>
38
+ <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </div>
files/sg_popup_create_new.php CHANGED
@@ -1,15 +1,17 @@
1
  <?php
2
-
3
  $popupType = @$_GET['type'];
4
  if (!$popupType) {
5
  $popupType = 'html';
6
  }
7
- if(isset($_GET['id'])) {
8
  $id = (int)$_GET['id'];
9
  $popupName = "SG".ucfirst(strtolower($popupType));
10
  $popupClassName = $popupName."Popup";
11
  require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
12
  $result = call_user_func(array($popupClassName, 'findById'), $id);
 
 
 
13
 
14
  switch ($popupType) {
15
  case 'iframe':
@@ -29,177 +31,320 @@
29
  break;
30
  case 'ageRestriction':
31
  $sgPopupAgeRestriction = ($result->getContent());
32
- $sgYesButton = checkVarebls($result->getYesButton());
33
- $sgNoButton = checkVarebls($result->getNoButton());
34
- $sgRestrictionUrl = checkVarebls($result->getRestrictionUrl());
35
  break;
36
  case 'countdown':
37
  $sgCoundownContent = ($result->getCountdownContent());
38
- $sgCloseType = checkVarebls($result->getCloseType());
39
- $sgClosingTime = checkVarebls($result->getClosingTime());
40
  break;
41
  case 'social':
42
  $sgSocialContent = ($result->getSocialContent());
43
- $sgSocialButtons = checkVarebls($result->getButtons());
44
- $sgSocialOptions = checkVarebls($result->getSocialOptions());
45
  break;
46
  }
 
47
  $title = $result->getTitle();
48
- $jsonData = json_decode($result->getOptions());
49
- $sgEscKey = $jsonData->escKey;
50
- $sgScrolling = $jsonData->scrolling;
51
- $sgCloseButton = $jsonData->closeButton;
52
- $sgReposition = $jsonData->reposition;
53
- $sgOverlayClose = $jsonData->overlayClose;
54
- $sgOverlayColor = $jsonData->sgOverlayColor;
55
- $sgContentClick = $jsonData->contentClick;
56
- $sgOpacity = $jsonData->opacity;
57
- $sgPopupFixed = $jsonData->popupFixed;
58
- $sgFixedPostion = $jsonData->fixedPostion;
59
- $sgOnScrolling = $jsonData->onScrolling;
60
- $beforeScrolingPrsent = $jsonData->beforeScrolingPrsent;
61
- $duration = $jsonData->duration;
62
- $delay = $jsonData->delay;
63
- $effect = $jsonData->effect;
64
- $sgInitialWidth = $jsonData->initialWidth;
65
- $sgInitialHeight = $jsonData->initialHeight;
66
- $sgWidth = $jsonData->width;
67
- $sgHeight = $jsonData->height;
68
- $sgMaxWidth = $jsonData->maxWidth;
69
- $sgMaxHeight = $jsonData->maxHeight;
70
- $sgForMobile = $jsonData->forMobile;
71
- $sgCountryStataus = $jsonData->countryStataus;
72
- $sgCountryIso = $jsonData->countryIso;
73
- $sgCountryName = $jsonData->countryName;
74
- $sgRepeatPopup = $jsonData->repeatPopup;
75
- $sgCountryAllow = $jsonData->allowCountris;
76
- $sgDisablePopup = $jsonData->disablePopup;
77
- $sgPopupClosingTimer = $jsonData->popupClosingTimer;
78
- $sgAutoClosePopup = $jsonData->autoClosePopup;
79
- $sgTheme = $jsonData->theme;
80
- $sgRestrictionAction = $jsonData->restrictionAction;
81
- $yesButtonBackgroundColor = checkVarebls($jsonData->yesButtonBackgroundColor);
82
- $noButtonBackgroundColor = checkVarebls($jsonData->noButtonBackgroundColor);
83
- $yesButtonTextColor = checkVarebls($jsonData->yesButtonTextColor);
84
- $noButtonTextColor = checkVarebls($jsonData->noButtonTextColor);
85
- $yesButtonRadius = checkVarebls($jsonData->yesButtonRadius);
86
- $noButtonRadius = checkVarebls($jsonData->noButtonRadius);
87
  $sgSocialOptions = json_decode(@$sgSocialOptions,true);
88
- $fbShareUrl = checkVarebls($sgSocialOptions['fbShareUrl']);
89
- $sgTwitte = checkVarebls($sgSocialOptions['sgTwitte']);
90
- $sgMailSubject = checkVarebls($sgSocialOptions['sgMailSubject']);
91
- $sgMailUlr = checkVarebls($sgSocialOptions['sgMailUlr']);
 
 
 
 
 
92
  $sgSocialButtons = json_decode(@$sgSocialButtons,true);
93
- $sgTwitterStatus = checkVarebls($sgSocialButtons['sgTwitterStatus']);
94
- $sgFbStatus = checkVarebls($sgSocialButtons['sgFbStatus']);
95
- $sgEmailStatus = checkVarebls($sgSocialButtons['sgEmailStatus']);
96
- $sgLinkedinStatus = checkVarebls($sgSocialButtons['sgLinkedinStatus']);
97
- $sgGoogleStatus = checkVarebls($sgSocialButtons['sgGoogleStatus']);
98
- $sgPinterestStatus = checkVarebls($sgSocialButtons['sgPinterestStatus']);
99
- $sgSocialTheme = checkVarebls($sgSocialOptions['sgSocialTheme']);
100
- $sgSocialButtonsSize = checkVarebls($sgSocialOptions['sgSocialButtonsSize']);
 
 
 
101
  }
102
- $colorbox_deafult_values = array('escKey'=> true,'closeButton' => true,'scale'=> true, 'scrolling'=> true,'opacity'=>0.8,'reposition' => true,'width' => false,'height' => false,'initialWidth'=>'300','initialHeight'=>'100','maxWidth'=>false,'maxHeight'=>false,'overlayClose'=>true,'contentClick'=>false,'fixed'=>false,'top'=>false,'right'=>false,'bottom'=>false,'left'=>false,"duration"=>1,"delay"=>0);
103
- $escKey = ($colorbox_deafult_values['escKey'] == true ? 'checked' : '');
104
- $closeButton = ($colorbox_deafult_values['closeButton'] == true ? 'checked' : '');
105
- $scale = ($colorbox_deafult_values['scale'] == true ? 'checked' : '');
106
- $scrolling = ($colorbox_deafult_values['scale'] == true ? 'checked' : '');
107
- $width = $colorbox_deafult_values['width'];
108
- $height = $colorbox_deafult_values['height'];
109
- $reposition = ($colorbox_deafult_values['reposition'] == true ? 'checked' : '');
110
- $overlayClose = ($colorbox_deafult_values['overlayClose'] == true ? 'checked' : '');
111
- $contentClick = ($colorbox_deafult_values['contentClick'] == true ? 'checked' : '');
112
- $opacityValue = $colorbox_deafult_values['opacity'];
113
- $top = $colorbox_deafult_values['top'];
114
- $right = $colorbox_deafult_values['right'];
115
- $bottom = $colorbox_deafult_values['bottom'];
116
- $left = $colorbox_deafult_values['left'];
117
- $initialWidth = $colorbox_deafult_values['initialWidth'];
118
- $initialHeight = $colorbox_deafult_values['initialHeight'];
119
- $maxWidth = $colorbox_deafult_values['maxWidth'];
120
- $maxHeight = $colorbox_deafult_values['maxHeight'];
121
- $deafultFixed = $colorbox_deafult_values['fixed'];
122
- $defaultDuration = $colorbox_deafult_values['duration'];
123
- $defaultDelay = $colorbox_deafult_values['delay'];
124
-
125
- if(isset($sgCloseType)) { $sgCloseType = ($sgCloseType == '') ? '': 'checked'; } else {$sgCloseType = '';}
126
- if(isset($sgEscKey)) {$sgEscKey = ($sgEscKey == '') ? '': 'checked'; } else {$sgEscKey = $escKey;}
127
- if(isset($sgCloseButton)) {$sgCloseButton = ($sgCloseButton == '') ? '': 'checked'; } else {$sgCloseButton = $closeButton;}
128
- if(isset($sgScrolling)) {$sgScrolling = ($sgScrolling == '') ? '': 'checked'; } else {$sgScrolling = $scrolling;}
129
- if(isset($sgReposition)) {$sgReposition = ($sgReposition == '') ? '': 'checked'; } else {$sgReposition = $reposition;}
130
- if(isset($sgOverlayClose)) {$sgOverlayClose = ($sgOverlayClose == '') ? '': 'checked'; } else {$sgOverlayClose = $overlayClose;}
131
- if(isset($sgContentClick)) {$sgContentClick = ($sgContentClick == '') ? '': 'checked'; } else {$sgContentClick = $contentClick;}
132
- if(isset($sgPopupFixed)) {$sgPopupFixed = ($sgPopupFixed == '') ? '': 'checked'; } else {$sgPopupFixed = $deafultFixed;}
133
- if(isset($sgOnScrolling)) {$sgOnScrolling = ($sgOnScrolling == '') ? '': 'checked'; }
134
- if(isset($sgForMobile)) {$sgForMobile = ($sgForMobile == '') ? '': 'checked'; }
135
- if(isset($sgRepeatPopup)) {$sgRepeatPopup = ($sgRepeatPopup == '') ? '': 'checked'; }else{$sgRepeatPopup = '';} //$sgCountryStataus
136
- if(isset($sgCountryStataus)) {$sgCountryStataus = ($sgCountryStataus== '') ? '': 'checked'; }else{$sgCountryStataus = '';}
137
- if(isset($sgDisablePopup)) {$sgDisablePopup = ($sgDisablePopup== '') ? '': 'checked'; }else{$sgDisablePopup = '';}
138
- if(isset($sgAutoClosePopup)) {$sgAutoClosePopup = ($sgAutoClosePopup== '') ? '': 'checked'; }else{$sgAutoClosePopup = '';}
139
- if(isset($sgFbStatus)) {$sgFbStatus = ($sgFbStatus== '') ? '': 'checked'; }else{$sgFbStatus = '';}
140
- if(isset($sgTwitterStatus)) {$sgTwitterStatus = ($sgTwitterStatus== '') ? '': 'checked'; }else{$sgTwitterStatus = '';}
141
- if(isset($sgEmailStatus)) {$sgEmailStatus = ($sgEmailStatus== '') ? '': 'checked'; }else{$sgEmailStatus = '';}
142
- if(isset($sgLinkedinStatus)) {$sgLinkedinStatus = ($sgLinkedinStatus== '') ? '': 'checked'; }else{$sgLinkedinStatus = '';}
143
- if(isset($sgGoogleStatus)) {$sgGoogleStatus = ($sgGoogleStatus== '') ? '': 'checked'; }else{$sgGoogleStatus = '';}
144
- if(isset($sgPinterestStatus)) {$sgPinterestStatus = ($sgPinterestStatus== '') ? '': 'checked'; }else{$sgPinterestStatus = '';}
145
- if(isset($sgRestrictionAction)) { if($sgRestrictionAction == 'byUrl') $restrictionAction2 = 'checked'; else $restrictionAction1 = 'checked';} else { $restrictionAction1 = 'checked';}
146
- if(!isset($sgOpacity )) {$sgOpacity = $opacityValue;}
147
- if(!isset($sgWidth )) {$sgWidth = $width;}
148
- if(!isset($sgHeight )) {$sgHeight = $height;}
149
- if(!isset($sgInitialWidth )) {$sgInitialWidth = $initialWidth;}
150
- if(!isset($sgInitialHeight)) {$sgInitialHeight = $initialHeight;}
151
- if(!isset($sgMaxWidth)) {$sgMaxWidth = $maxWidth;}
152
- if(!isset($sgMaxWidth)) {$sgMaxHeight = $maxHeight;}
153
- if(!isset($duration)) {$duration = $defaultDuration;}
154
- if(!isset($delay)) {$delay = $defaultDelay;}
155
- if(!isset($sgPopupDataIframe)) {$sgPopupDataIframe = 'http://';}
156
- if(!isset($sgPopupDataHtml)) {$sgPopupDataHtml = '';}
157
- if(!isset($sgPopupDataImage)) {$sgPopupDataImage = '';}
158
- $restrictionAction2 = '';
159
- $restrictionAction1 = 'checked';
160
- if(@$sgRestrictionAction == 'closeTab') {
161
- $restrictionAction2 = 'checked';
162
- $restrictionAction1 = '';
 
 
 
 
163
  }
164
- else {
165
- $restrictionAction2 = '';
166
- $restrictionAction1 = 'checked';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  }
168
-
169
- function checkVarebls($varieble) {
170
- if(isset($varieble)) {
171
- return $varieble;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  }
173
  else {
174
- return '';
175
  }
176
  }
177
- //select basa value or deafult value
178
- $sg_popup_effects = array("No effect"=>"No Effect","flip"=>"flip","shake"=>"shake","wobble"=>"wobble","swing"=>"swing","flash"=>"flash","bounce"=>"bounce","pulse"=>"pulse","rubberBand"=>"rubberBand","tada"=>"tada","fadeIn"=>"fadeIn");
179
- $sg_popup_theme = array("colorbox1.css","colorbox2.css","colorbox3.css","colorbox4.css","colorbox5.css");
180
- $sg_theme = array("flat"=>"flat","classic"=>"classic","minima"=>"minima","plain"=>"plain");
181
- $sg_theme_size = array("8"=>"8","10"=>"10","12"=>"12","14"=>"14","16"=>"16","18"=>"18","20"=>"20","24"=>"24");
182
 
183
- function creaeSelect($options,$name,$selecteOption)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  {
185
  $selected ='';
186
  $str = "";
187
  $checked = "";
188
- if($name == 'theme' || $name == 'restrictionAction') {
189
-
190
  $popup_style_name = 'popup_theme_name';
191
  $firstOption = array_shift($options);
192
  $i = 1;
193
- foreach($options as $key){
194
- if($key == $selecteOption) {
195
- $checked = "checked";
196
- }
197
 
198
- else {
199
- $checked ='';
200
  }
201
  $i++;
202
- $str .= "<input type='radio' name=\"$name\" value=\"$key\" $checked class='popup_theme_name' sgPoupNumber=".$i.">";
203
 
204
  }
205
  if ($checked == ''){
@@ -210,15 +355,15 @@
210
  }
211
  else {
212
  @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
213
- $str .= "<select name=$name id='sameWidthinputs' class=$popup_style_name >";
214
- foreach($options as $key=>$option) {
215
- if($key == $selecteOption) {
216
  $selected = "selected";
217
  }
218
  else {
219
  $selected ='';
220
- }
221
- $str .= "<option value='".$key."' ".$selected." >$option</potion>";
222
  }
223
 
224
  $str .="</select>" ;
@@ -226,48 +371,44 @@
226
 
227
  }
228
 
229
- } ?>
230
-
231
- <?php
232
- if(isset($_GET['saved']) && $_GET['saved']==1)
233
- {
234
- echo '<div id="defaultMessage" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
235
- }
236
- ?>
 
237
  <form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php" id="add-form">
238
  <input type="hidden" name="action" value="save_popup">
239
- <div class="crudWrapper">
240
- <div class="cereateTitleWrapper">
241
- <div class="Sg_title_crud">
242
- <?php if(isset($id))
243
- { ?>
244
- <h2>Edit popup</h2>
245
-
246
- <?php }
247
- else { ?>
248
  <h2>Create new popup</h2>
249
- <?php } ?>
250
  </div>
251
- <div class="buttonWrapper">
252
  <p class="submit">
253
- <?php
254
- if(!SG_POPUP_PRO) { ?>
255
- <input class="crudToPro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
256
- <?php } ?>
257
- <input type="submit" id="promotionalSaveButton" class="button-primary" value="<?php echo 'Save Changes'; ?>" />
258
- <img id="createAjaxLoader" src="<?php echo plugins_url('img/wpspin_light.gif', dirname(__FILE__).'../');?>" style="display: none">
259
  </p>
260
  </div>
261
  </div>
262
  <div class="clear"></div>
263
- <div class="generalWrapper">
264
  <div id="titlediv">
265
  <div id="titlewrap">
266
- <input style="margin-top: 5px;" type="text" name="title" size="30" value="<?php echo esc_attr(@$title)?>" id="title" spellcheck="true" autocomplete="off" required = "required" placeholder='Enter title here'>
267
  </div>
268
  </div>
269
- <div id="leftMainDiv">
270
- <div id="general">
271
  <div id="post-body" class="metabox-holder columns-2">
272
  <div id="postbox-container-2" class="postbox-container">
273
  <div id="normal-sortables" class="meta-box-sortables ui-sortable">
@@ -275,10 +416,15 @@
275
  <div class="handlediv generalTitle" title="Click to toggle"><br></div>
276
  <h3 class="hndle ui-sortable-handle generalTitle" style="cursor: pointer"><span>General</span></h3>
277
  <div class="generalContent sgSameWidthPostBox">
278
- <?php require_once("main_".$popupType."_section.php");?>
279
  <input type="hidden" name="type" value="<?php echo $popupType;?>">
280
- <span class="createDescribe" id="themeSPan">Popup theme:</span>
281
- <?php echo creaeSelect($sg_popup_theme,'theme',esc_html(@$sgTheme));?><div class="theme1" id="displayNone"></div><div class="theme2" id="displayNone"></div><div class="theme3" id="displayNone" ></div><div class="theme4" id="displayNone" ></div><div class="theme5" id="displayNone"></div>
 
 
 
 
 
282
  </div>
283
  </div>
284
 
@@ -294,15 +440,16 @@
294
  <div class="handlediv effectTitle" title="Click to toggle"><br></div>
295
  <h3 class="hndle ui-sortable-handle effectTitle" style="cursor: pointer"><span>Effects</span></h3>
296
  <div class="effectsContent">
297
- <span class="createDescribe">Effect type:</span>
298
- <?php echo creaeSelect($sg_popup_effects,'effect',esc_html(@$effect));?>
 
299
  <div class="effectWrapper"><div id="effectShow" ></div></div>
300
-
301
- <span class="createDescribe">Effect duration:</span>
302
- <input class='sameWidthinputs' type="text" name="duration" value="<?php echo esc_attr($duration); ?>" pattern = "\d+" title="It's must be number" /><span class="dashicons dashicons-info contentClick infoImageDuration sameImageStyle"></span><span class="infoDuration samefontStyle">Specify how long the popup appearance animation should take (in sec).</span></br>
303
-
304
- <span class="createDescribe">Initial delay:</span>
305
- <input class='sameWidthinputs' type="text" name="delay" value="<?php echo esc_attr($delay);?>" pattern = "\d+" title="It's must be number"/><span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span><span class="infoDelay samefontStyle">Specify how long the popup appearance should be delayed after loading the page (in sec).</span></br>
306
  </div>
307
  </div>
308
 
@@ -310,12 +457,10 @@
310
  </div>
311
  </div>
312
  </div>
313
-
314
-
315
- <?php require_once("options_".$popupType."_section.php");?>
316
- </div>
317
- <div id="rightMaindiv">
318
- <div id="rightMain">
319
  <div id="dimentions">
320
  <div id="post-body" class="metabox-holder columns-2">
321
  <div id="postbox-container-2" class="postbox-container">
@@ -324,18 +469,18 @@
324
  <div class="handlediv dimentionsTitle" title="Click to toggle"><br></div>
325
  <h3 class="hndle ui-sortable-handle dimentionsTitle" style="cursor: pointer"><span>Dimensions</span></h3>
326
  <div class="dimensionsContent">
327
- <span class="createDescribe">Width:</span>
328
- <input class='sameWidthinputs' type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
329
- <span class="createDescribe">Height:</span>
330
- <input class='sameWidthinputs' type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
331
- <span class="createDescribe">Max width:</span>
332
- <input class='sameWidthinputs' type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
333
- <span class="createDescribe">Max height:</span>
334
- <input class='sameWidthinputs' type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
335
- <span class="createDescribe">Initial width:</span>
336
- <input class='sameWidthinputs' type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
337
- <span class="createDescribe">Initial height:</span>
338
- <input class='sameWidthinputs' type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It's must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
339
  </div>
340
  </div>
341
 
@@ -351,47 +496,46 @@
351
  <div class="handlediv optionsTitle" title="Click to toggle"><br></div>
352
  <h3 class="hndle ui-sortable-handle optionsTitle" style="cursor: pointer"><span>Options</span></h3>
353
  <div class="optionsContent">
354
- <span class="createDescribe">Dismiss on &quot;esc&quot; key:</span><input class='sameWidthinputs' type="checkbox" name="escKey" <?php echo $sgEscKey;?>/>
355
  <span class="dashicons dashicons-info escKeyImg sameImageStyle"></span><span class="infoEscKey samefontStyle">The popup will be dismissed when user presses on 'esc' key.</span></br>
356
-
357
- <span class="createDescribe" id="createDescribeClose">Show &quot;close&quot; button:</span><input class='sameWidthinputs' type="checkbox" name="closeButton" <?php echo $sgCloseButton;?> />
358
  <span class="dashicons dashicons-info CloseImg sameImageStyle"></span><span class="infoCloseButton samefontStyle">The popup will contain 'close' button.</span><br>
359
-
360
- <span class="createDescribe">Enable content scrolling:</span><input class='sameWidthinputs' type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
361
  <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the containt is larger then the specified dimentions, then the content will be scrollable.</span><br>
362
-
363
- <span class="createDescribe">Enable responsiveness:</span><input class='sameWidthinputs' type="checkbox" name="reposition" <?php echo $sgReposition;?> />
364
  <span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
365
-
366
- <span class="createDescribe">Dismiss on overlay click:</span><input class='sameWidthinputs' type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
367
  <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks beyond of the popup area.</span><br>
368
-
369
- <span class="createDescribe">Dismiss on content click:</span><input class='sameWidthinputs' type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
370
  <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
371
-
372
- <span class="createDescribe">Change overlay color:</span><div id="colorPiccer"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
373
 
374
- <span class="createDescribe" id="createDescribeOpacitcy">Background overlay opacity:</span><div class="slider-wrapper">
 
 
375
  <input type="text" class="js-decimal" value="<?php echo esc_attr($sgOpacity);?>" rel="<?php echo esc_attr($sgOpacity);?>" name="opacity"/>
376
  <div id="js-display-decimal" class="display-box"></div>
377
- </div><br>
378
-
379
- <span class="createDescribe" id="createDescribeFixed">Popup location:</span><input class='sameWidthinputs' type="checkbox" name="popupFixed" id="popupFixed" <?php echo $sgPopupFixed;?> /><br>
380
- <div class="popopFixeds">
381
- <span class="forFixWrapperStyle" >&nbsp;</span>
382
- <div class="fixedWrapper" >
383
- <div class="fixedPositionStyle" id="fixedPosition1" data-sgvalue="1"></div>
384
- <div id="fixedPosition2" data-sgvalue="2"></div>
385
- <div class="fixedPositionStyle" id="fixedPosition3" data-sgvalue="3"></div>
386
- <div id="fixedPosition4" data-sgvalue="4"></div>
387
- <div class="fixedPositionStyle" id="fixedPosition5" data-sgvalue="5"></div>
388
- <div id="fixedPosition6" data-sgvalue="6"></div>
389
- <div class="fixedPositionStyle" id="fixedPosition7" data-sgvalue="7"></div>
390
- <div id="fixedPosition8" data-sgvalue="8"></div>
391
- <div class="fixedPositionStyle" id="fixedPosition9" data-sgvalue="9"></div>
392
  </div>
393
  </div>
394
- <input type="hidden" name="fixedPostion" class="fixedPostion" value="<?php echo esc_attr(@$sgFixedPostion);?>">
395
  </div>
396
  </div>
397
 
@@ -399,15 +543,15 @@
399
  </div>
400
  </div>
401
  </div>
402
- <?php
403
  if (SG_POPUP_PRO) {
404
- require_once("options_pro_section.php");
405
  }
406
  ?>
407
  </div>
408
  </div>
409
  <div class="clear"></div>
410
  <input type="hidden" class="button-primary" value="<?php echo esc_attr(@$id);?>" name="hidden_popup_number" />
411
- </div>
412
  </div>
413
  </form>
1
  <?php
 
2
  $popupType = @$_GET['type'];
3
  if (!$popupType) {
4
  $popupType = 'html';
5
  }
6
+ if (isset($_GET['id'])) {
7
  $id = (int)$_GET['id'];
8
  $popupName = "SG".ucfirst(strtolower($popupType));
9
  $popupClassName = $popupName."Popup";
10
  require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
11
  $result = call_user_func(array($popupClassName, 'findById'), $id);
12
+ if (!$result) {
13
+ wp_redirect(SG_APP_POPUP_ADMIN_URL."page=edit-popup&type=".$popupType."");
14
+ }
15
 
16
  switch ($popupType) {
17
  case 'iframe':
31
  break;
32
  case 'ageRestriction':
33
  $sgPopupAgeRestriction = ($result->getContent());
34
+ $sgYesButton = sgSafeStr($result->getYesButton());
35
+ $sgNoButton = sgSafeStr($result->getNoButton());
36
+ $sgRestrictionUrl = sgSafeStr($result->getRestrictionUrl());
37
  break;
38
  case 'countdown':
39
  $sgCoundownContent = ($result->getCountdownContent());
40
+ $sgCloseType = sgSafeStr($result->getCloseType());
41
+ $sgClosingTime = sgSafeStr($result->getClosingTime());
42
  break;
43
  case 'social':
44
  $sgSocialContent = ($result->getSocialContent());
45
+ $sgSocialButtons = sgSafeStr($result->getButtons());
46
+ $sgSocialOptions = sgSafeStr($result->getSocialOptions());
47
  break;
48
  }
49
+
50
  $title = $result->getTitle();
51
+ $jsonData = json_decode($result->getOptions(), true);
52
+ $sgEscKey = @$jsonData['escKey'];
53
+ $sgScrolling = @$jsonData['scrolling'];
54
+ $sgCloseButton = @$jsonData['closeButton'];
55
+ $sgReposition = @$jsonData['reposition'];
56
+ $sgOverlayClose = @$jsonData['overlayClose'];
57
+ $sgOverlayColor = @$jsonData['sgOverlayColor'];
58
+ $sgContentClick = @$jsonData['contentClick'];
59
+ $sgOpacity = @$jsonData['opacity'];
60
+ $sgPopupFixed = @$jsonData['popupFixed'];
61
+ $sgFixedPostion = @$jsonData['fixedPostion'];
62
+ $sgOnScrolling = @$jsonData['onScrolling'];
63
+ $beforeScrolingPrsent = @$jsonData['beforeScrolingPrsent'];
64
+ $duration = @$jsonData['duration'];
65
+ $delay = @$jsonData['delay'];
66
+ $effect =@$jsonData['effect'];
67
+ $sgInitialWidth = @$jsonData['initialWidth'];
68
+ $sgInitialHeight = @$jsonData['initialHeight'];
69
+ $sgWidth = @$jsonData['width'];
70
+ $sgHeight = @$jsonData['height'];
71
+ $sgMaxWidth = @$jsonData['maxWidth'];
72
+ $sgMaxHeight = @$jsonData['maxHeight'];
73
+ $sgForMobile = @$jsonData['forMobile'];
74
+ $sgRepeatPopup = @$jsonData['repeatPopup'];
75
+ $sgDisablePopup = @$jsonData['disablePopup'];
76
+ $sgPopupClosingTimer = @$jsonData['popupClosingTimer'];
77
+ $sgAutoClosePopup = @$jsonData['autoClosePopup'];
78
+ $sgColorboxTheme = @$jsonData['theme'];
79
+ $sgRestrictionAction = @$jsonData['restrictionAction'];
80
+ $yesButtonBackgroundColor = @sgSafeStr($jsonData['yesButtonBackgroundColor']);
81
+ $noButtonBackgroundColor = @sgSafeStr($jsonData['noButtonBackgroundColor']);
82
+ $yesButtonTextColor = @sgSafeStr($jsonData['yesButtonTextColor']);
83
+ $noButtonTextColor = @sgSafeStr($jsonData['noButtonTextColor']);
84
+ $yesButtonRadius = @sgSafeStr($jsonData['yesButtonRadius']);
85
+ $noButtonRadius = @sgSafeStr($jsonData['noButtonRadius']);
 
 
 
 
86
  $sgSocialOptions = json_decode(@$sgSocialOptions,true);
87
+ $sgShareUrl = @sgSafeStr($sgSocialOptions['sgShareUrl']);
88
+ $shareUrlType = @sgSafeStr($sgSocialOptions['shareUrlType']);
89
+ $fbShareLabel = @sgSafeStr($sgSocialOptions['fbShareLabel']);
90
+ $lindkinLabel = @sgSafeStr($sgSocialOptions['lindkinLabel']);
91
+ $googLelabel = @sgSafeStr($sgSocialOptions['googLelabel']);
92
+ $twitterLabel = @sgSafeStr($sgSocialOptions['twitterLabel']);
93
+ $pinterestLabel = @sgSafeStr($sgSocialOptions['pinterestLabel']);
94
+ $sgMailSubject = @sgSafeStr($sgSocialOptions['sgMailSubject']);
95
+ $sgMailLable = @sgSafeStr($sgSocialOptions['sgMailLable']);
96
  $sgSocialButtons = json_decode(@$sgSocialButtons,true);
97
+ $sgTwitterStatus = @sgSafeStr($sgSocialButtons['sgTwitterStatus']);
98
+ $sgFbStatus = @sgSafeStr($sgSocialButtons['sgFbStatus']);
99
+ $sgEmailStatus = @sgSafeStr($sgSocialButtons['sgEmailStatus']);
100
+ $sgLinkedinStatus = @sgSafeStr($sgSocialButtons['sgLinkedinStatus']);
101
+ $sgGoogleStatus = @sgSafeStr($sgSocialButtons['sgGoogleStatus']);
102
+ $sgPinterestStatus = @sgSafeStr($sgSocialButtons['sgPinterestStatus']);
103
+ $sgSocialTheme = @sgSafeStr($sgSocialOptions['sgSocialTheme']);
104
+ $sgSocialButtonsSize = @sgSafeStr($sgSocialOptions['sgSocialButtonsSize']);
105
+ $sgSocialLabel = @sgSafeStr($sgSocialOptions['sgSocialLabel']);
106
+ $sgSocialShareCount = @sgSafeStr($sgSocialOptions['sgSocialShareCount']);
107
+ $sgRoundButton = @sgSafeStr($sgSocialOptions['sgRoundButton']);
108
  }
109
+ $colorboxDeafultValues = array(
110
+ 'escKey'=> true,
111
+ 'closeButton' => true,
112
+ 'scrolling'=> true,
113
+ 'opacity'=>0.8,
114
+ 'reposition' => true,
115
+ 'width' => false,
116
+ 'height' => false,
117
+ 'initialWidth' => '300',
118
+ 'initialHeight' => '100',
119
+ 'maxWidth' => false,
120
+ 'maxHeight' => false,
121
+ 'overlayClose' => true,
122
+ 'contentClick'=>false,
123
+ 'fixed' => false,
124
+ 'top' => false,
125
+ 'right' => false,
126
+ 'bottom' => false,
127
+ 'left' => false,
128
+ 'duration' => 1,
129
+ 'delay' => 0,
130
+ );
131
+
132
+ $popupProDefaultValues = array(
133
+ 'closeType' => false,
134
+ 'onScrolling' => false,
135
+ 'forMobile' => false,
136
+ 'repetPopup' => false,
137
+ 'disablePopup' => false,
138
+ 'autoClosePopup' => false,
139
+ 'fbStatus' => true,
140
+ 'twitterStatus' => true,
141
+ 'emailStatus' => true,
142
+ 'linkedinStatus' => true,
143
+ 'googleStatus' => true,
144
+ 'pinterestStatus' => true,
145
+ 'sgSocialLabel'=>true,
146
+ 'roundButtons'=>false
147
+ );
148
+
149
+ $escKey = sgBoolToChecked($colorboxDeafultValues['escKey']);
150
+ $closeButton = sgBoolToChecked($colorboxDeafultValues['closeButton']);
151
+ $scrolling = sgBoolToChecked($colorboxDeafultValues['scrolling']);
152
+ $reposition = sgBoolToChecked($colorboxDeafultValues['reposition']);
153
+ $overlayClose = sgBoolToChecked($colorboxDeafultValues['overlayClose']);
154
+ $contentClick = sgBoolToChecked($colorboxDeafultValues['contentClick']);
155
+
156
+ $closeType = sgBoolToChecked($popupProDefaultValues['closeType']);
157
+ $onScrolling = sgBoolToChecked($popupProDefaultValues['onScrolling']);
158
+ $forMobile = sgBoolToChecked($popupProDefaultValues['forMobile']);
159
+ $repetPopup = sgBoolToChecked($popupProDefaultValues['repetPopup']);
160
+ $disablePopup = sgBoolToChecked($popupProDefaultValues['disablePopup']);
161
+ $autoClosePopup = sgBoolToChecked($popupProDefaultValues['autoClosePopup']);
162
+ $fbStatus = sgBoolToChecked($popupProDefaultValues['fbStatus']);
163
+ $twitterStatus = sgBoolToChecked($popupProDefaultValues['twitterStatus']);
164
+ $emailStatus = sgBoolToChecked($popupProDefaultValues['emailStatus']);
165
+ $linkedinStatus = sgBoolToChecked($popupProDefaultValues['linkedinStatus']);
166
+ $googleStatus = sgBoolToChecked($popupProDefaultValues['googleStatus']);
167
+ $pinterestStatus = sgBoolToChecked($popupProDefaultValues['pinterestStatus']);
168
+ $socialLabel = sgBoolToChecked($popupProDefaultValues['sgSocialLabel']);
169
+ $roundButtons = sgBoolToChecked($popupProDefaultValues['roundButtons']);
170
+
171
+ function sgBoolToChecked($var)
172
+ {
173
+ return ($var?'checked':'');
174
  }
175
+
176
+ $width = $colorboxDeafultValues['width'];
177
+ $height = $colorboxDeafultValues['height'];
178
+ $opacityValue = $colorboxDeafultValues['opacity'];
179
+ $top = $colorboxDeafultValues['top'];
180
+ $right = $colorboxDeafultValues['right'];
181
+ $bottom = $colorboxDeafultValues['bottom'];
182
+ $left = $colorboxDeafultValues['left'];
183
+ $initialWidth = $colorboxDeafultValues['initialWidth'];
184
+ $initialHeight = $colorboxDeafultValues['initialHeight'];
185
+ $maxWidth = $colorboxDeafultValues['maxWidth'];
186
+ $maxHeight = $colorboxDeafultValues['maxHeight'];
187
+ $deafultFixed = $colorboxDeafultValues['fixed'];
188
+ $defaultDuration = $colorboxDeafultValues['duration'];
189
+ $defaultDelay = $colorboxDeafultValues['delay'];
190
+
191
+ $sgCloseButton = @sgSetChecked($sgCloseButton, $closeButton);
192
+ $sgEscKey = @sgSetChecked($sgEscKey, $escKey);
193
+ $sgContentClick = @sgSetChecked($sgContentClick, $contentClick);
194
+ $sgOverlayClose = @sgSetChecked($sgOverlayClose, $overlayClose);
195
+ $sgReposition = @sgSetChecked($sgReposition, $reposition);
196
+ $sgScrolling = @sgSetChecked($sgScrolling, $scrolling);
197
+
198
+ $sgCloseType = @sgSetChecked($sgCloseType, $closeType);
199
+ $sgOnScrolling = @sgSetChecked($sgOnScrolling, $onScrolling);
200
+ $sgForMobile = @sgSetChecked($sgForMobile, $forMobile);
201
+ $sgRepeatPopup = @sgSetChecked($sgRepeatPopup, $repetPopup);
202
+ $sgDisablePopup = @sgSetChecked($sgDisablePopup, $disablePopup);
203
+ $sgAutoClosePopup = @sgSetChecked($sgAutoClosePopup, $autoClosePopup);
204
+ $sgFbStatus = @sgSetChecked($sgFbStatus, $fbStatus);
205
+ $sgTwitterStatus = @sgSetChecked($sgTwitterStatus, $twitterStatus);
206
+ $sgEmailStatus = @sgSetChecked($sgEmailStatus, $emailStatus);
207
+ $sgLinkedinStatus = @sgSetChecked($sgLinkedinStatus, $linkedinStatus);
208
+ $sgGoogleStatus = @sgSetChecked($sgGoogleStatus, $googleStatus);
209
+ $sgPinterestStatus = @sgSetChecked($sgPinterestStatus, $pinterestStatus);
210
+ $sgRoundButtons = @sgSetChecked($sgRoundButton, $roundButtons);
211
+ $sgSocialLabel = @sgSetChecked($sgSocialLabel, $socialLabel);
212
+ $sgPopupFixed = @sgSetChecked($sgPopupFixed, $deafultFixed);
213
+
214
+ function sgSetChecked($optionsParam,$defaultOption)
215
+ {
216
+ if (isset($optionsParam)) {
217
+ if ($optionsParam == '') {
218
+ return '';
219
+ }
220
+ else {
221
+ return 'checked';
222
+ }
223
+ }
224
+ else {
225
+ return $defaultOption;
226
+ }
227
  }
228
+
229
+ $sgOpacity = @sgGetValue($sgOpacity, $opacityValue);
230
+ $sgWidth = @sgGetValue($sgWidth, $width);
231
+ $sgHeight = @sgGetValue($sgHeight, $height);
232
+ $sgInitialWidth = @sgGetValue($sgInitialWidth, $initialWidth);
233
+ $sgInitialHeight = @sgGetValue($sgInitialHeight, $initialHeight);
234
+ $sgMaxWidth = @sgGetValue($sgMaxWidth, $maxWidth);
235
+ $sgMaxHeight = @sgGetValue($sgMaxHeight, $maxHeight);
236
+ $duration = @sgGetValue($duration, $defaultDuration);
237
+ $delay = @sgGetValue($delay, $defaultDelay);
238
+ $sgPopupDataIframe = @sgGetValue($sgPopupDataIframe, 'http://');
239
+ $sgPopupDataHtml = @sgGetValue($sgPopupDataHtml, '');
240
+ $sgPopupDataImage = @sgGetValue($sgPopupDataImage, '');
241
+
242
+ function sgGetValue($getedVal,$defValue)
243
+ {
244
+ if (!isset($getedVal)) {
245
+ return $defValue;
246
  }
247
  else {
248
+ return $getedVal;
249
  }
250
  }
 
 
 
 
 
251
 
252
+ $radioElements = array(
253
+ array(
254
+ 'name'=>'shareUrlType',
255
+ 'value'=>'activeUrl',
256
+ 'additionalHtml'=>''.'<span>'.'Use active URL'.'</span></span>'
257
+ ),
258
+ array(
259
+ 'name'=>'shareUrlType',
260
+ 'value'=>'shareUrl',
261
+ 'additionalHtml'=>''.'<span>'.'Enter to share URL'.'</span></span>'.'<input class="input-width-static" type="text" name="sgShareUrl" value="'.@$sgShareUrl.'">'
262
+ )
263
+ );
264
+
265
+ function sgCreateRadioElements($radioElements,$checkedValue)
266
+ {
267
+ $content = '';
268
+ for ($i = 0; $i < count($radioElements); $i++) {
269
+ $checked = '';
270
+ $radioElement = @$radioElements[$i];
271
+ $name = @$radioElement['name'];
272
+ $label = @$radioElement['label'];
273
+ $value = @$radioElement['value'];
274
+ $additionalHtml = @$radioElement['additionalHtml'];
275
+ if ($checkedValue == $value) {
276
+ $checked = 'checked';
277
+ }
278
+ $content .= '<span class="liquid-width"><input class="radio-btn-fix" type="radio" name="'.$name.'" value="'.$value.'" '.$checked.'>';
279
+ $content .= $additionalHtml."<br>";
280
+ }
281
+ return $content;
282
+ }
283
+
284
+ $sgPopupEffects = array(
285
+ 'No effect' => 'No Effect',
286
+ 'flip' => 'flip',
287
+ 'shake' => 'shake',
288
+ 'wobble' => 'wobble',
289
+ 'swing' => 'swing',
290
+ 'flash' => 'flash',
291
+ 'bounce' => 'bounce',
292
+ 'pulse' => 'pulse',
293
+ 'rubberBand' => 'rubberBand',
294
+ 'tada' => 'tada',
295
+ 'fadeIn' => 'fadeIn'
296
+ );
297
+
298
+ $sgPopupTheme = array(
299
+ 'colorbox1.css',
300
+ 'colorbox2.css',
301
+ 'colorbox3.css',
302
+ 'colorbox4.css',
303
+ 'colorbox5.css'
304
+ );
305
+
306
+ $sgTheme = array(
307
+ 'flat' => 'flat',
308
+ 'classic' => 'classic',
309
+ 'minima' => 'minima',
310
+ 'plain' => 'plain'
311
+ );
312
+
313
+ $sgThemeSize = array(
314
+ '8' => '8',
315
+ '10' => '10',
316
+ '12' => '12',
317
+ '14' => '14',
318
+ '16' => '16',
319
+ '18' => '18',
320
+ '20' => '20',
321
+ '24' => '24'
322
+ );
323
+
324
+ $sgSocialCount = array(
325
+ 'true' => 'True',
326
+ 'false' => 'False',
327
+ 'inside' => 'Inside'
328
+ );
329
+
330
+ function sgCreateSelect($options,$name,$selecteOption)
331
  {
332
  $selected ='';
333
  $str = "";
334
  $checked = "";
335
+ if ($name == 'theme' || $name == 'restrictionAction') {
336
+
337
  $popup_style_name = 'popup_theme_name';
338
  $firstOption = array_shift($options);
339
  $i = 1;
340
+ foreach ($options as $key) {
341
+ $checked ='';
 
 
342
 
343
+ if ($key == $selecteOption) {
344
+ $checked = "checked";
345
  }
346
  $i++;
347
+ $str .= "<input type='radio' name=\"$name\" value=\"$key\" $checked class='popup_theme_name' sgPoupNumber=".$i.">";
348
 
349
  }
350
  if ($checked == ''){
355
  }
356
  else {
357
  @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
358
+ $str .= "<select name=$name class=$popup_style_name input-width-static >";
359
+ foreach ($options as $key=>$option) {
360
+ if ($key == $selecteOption) {
361
  $selected = "selected";
362
  }
363
  else {
364
  $selected ='';
365
+ }
366
+ $str .= "<option value='".$key."' ".$selected." >$option</potion>";
367
  }
368
 
369
  $str .="</select>" ;
371
 
372
  }
373
 
374
+ }
375
+ if (isset($_GET['saved']) && $_GET['saved']==1) {
376
+ echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
377
+ }
378
+ if (isset($_GET["titleError"])): ?>
379
+ <div class="error notice" id="title-error-message">
380
+ <p>Invalid Title</p>
381
+ </div>
382
+ <?php endif; ?>
383
  <form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php" id="add-form">
384
  <input type="hidden" name="action" value="save_popup">
385
+ <div class="crud-wrapper">
386
+ <div class="cereate-title-wrapper">
387
+ <div class="sg-title-crud">
388
+ <?php if (isset($id)): ?>
389
+ <h2>Edit popup</h2>
390
+ <?php else: ?>
 
 
 
391
  <h2>Create new popup</h2>
392
+ <?php endif; ?>
393
  </div>
394
+ <div class="button-wrapper">
395
  <p class="submit">
396
+ <?php if (!SG_POPUP_PRO): ?>
397
+ <input class="crud-to-pro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
398
+ <?php endif; ?>
399
+ <input type="submit" id="sg-save-button" class="button-primary" value="<?php echo 'Save Changes'; ?>">
 
 
400
  </p>
401
  </div>
402
  </div>
403
  <div class="clear"></div>
404
+ <div class="general-wrapper">
405
  <div id="titlediv">
406
  <div id="titlewrap">
407
+ <input id="title" class="sg-js-popup-title" type="text" name="title" size="30" value="<?php echo esc_attr(@$title)?>" spellcheck="true" autocomplete="off" required = "required" placeholder='Enter title here'>
408
  </div>
409
  </div>
410
+ <div id="left-main-div">
411
+ <div id="sg-general">
412
  <div id="post-body" class="metabox-holder columns-2">
413
  <div id="postbox-container-2" class="postbox-container">
414
  <div id="normal-sortables" class="meta-box-sortables ui-sortable">
416
  <div class="handlediv generalTitle" title="Click to toggle"><br></div>
417
  <h3 class="hndle ui-sortable-handle generalTitle" style="cursor: pointer"><span>General</span></h3>
418
  <div class="generalContent sgSameWidthPostBox">
419
+ <?php require_once("main_section/".$popupType.".php");?>
420
  <input type="hidden" name="type" value="<?php echo $popupType;?>">
421
+ <span class="liquid-width" id="theme-span">Popup theme:</span>
422
+ <?php echo sgCreateSelect($sgPopupTheme,'theme',esc_html(@$sgColorboxTheme));?>
423
+ <div class="theme1 sg-hide"></div>
424
+ <div class="theme2 sg-hide"></div>
425
+ <div class="theme3 sg-hide"></div>
426
+ <div class="theme4 sg-hide"></div>
427
+ <div class="theme5 sg-hide"></div>
428
  </div>
429
  </div>
430
 
440
  <div class="handlediv effectTitle" title="Click to toggle"><br></div>
441
  <h3 class="hndle ui-sortable-handle effectTitle" style="cursor: pointer"><span>Effects</span></h3>
442
  <div class="effectsContent">
443
+ <span class="liquid-width">Effect type:</span>
444
+ <?php echo sgCreateSelect($sgPopupEffects,'effect',esc_html(@$effect));?>
445
+ <span class="js-preview-effect"></span>
446
  <div class="effectWrapper"><div id="effectShow" ></div></div>
447
+
448
+ <span class="liquid-width">Effect duration:</span>
449
+ <input class="input-width-static" type="text" name="duration" value="<?php echo esc_attr($duration); ?>" pattern = "\d+" title="It must be number" /><span class="dashicons dashicons-info contentClick infoImageDuration sameImageStyle"></span><span class="infoDuration samefontStyle">Specify how long the popup appearance animation should take (in sec).</span></br>
450
+
451
+ <span class="liquid-width">Initial delay:</span>
452
+ <input class="input-width-static" type="text" name="delay" value="<?php echo esc_attr($delay);?>" pattern = "\d+" title="It must be number"/><span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span><span class="infoDelay samefontStyle">Specify how long the popup appearance should be delayed after loading the page (in sec).</span></br>
453
  </div>
454
  </div>
455
 
457
  </div>
458
  </div>
459
  </div>
460
+ <?php require_once("options_section/".$popupType.".php");?>
461
+ </div>
462
+ <div id="right-main-div">
463
+ <div id="right-main">
 
 
464
  <div id="dimentions">
465
  <div id="post-body" class="metabox-holder columns-2">
466
  <div id="postbox-container-2" class="postbox-container">
469
  <div class="handlediv dimentionsTitle" title="Click to toggle"><br></div>
470
  <h3 class="hndle ui-sortable-handle dimentionsTitle" style="cursor: pointer"><span>Dimensions</span></h3>
471
  <div class="dimensionsContent">
472
+ <span class="liquid-width">Width:</span>
473
+ <input class="input-width-static" type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
474
+ <span class="liquid-width">Height:</span>
475
+ <input class="input-width-static" type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
476
+ <span class="liquid-width">Max width:</span>
477
+ <input class="input-width-static" type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
478
+ <span class="liquid-width">Max height:</span>
479
+ <input class="input-width-static" type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
480
+ <span class="liquid-width">Initial width:</span>
481
+ <input class="input-width-static" type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
482
+ <span class="liquid-width">Initial height:</span>
483
+ <input class="input-width-static" type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|\%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
484
  </div>
485
  </div>
486
 
496
  <div class="handlediv optionsTitle" title="Click to toggle"><br></div>
497
  <h3 class="hndle ui-sortable-handle optionsTitle" style="cursor: pointer"><span>Options</span></h3>
498
  <div class="optionsContent">
499
+ <span class="liquid-width">Dismiss on &quot;esc&quot; key:</span><input class="input-width-static" type="checkbox" name="escKey" <?php echo $sgEscKey;?>/>
500
  <span class="dashicons dashicons-info escKeyImg sameImageStyle"></span><span class="infoEscKey samefontStyle">The popup will be dismissed when user presses on 'esc' key.</span></br>
501
+
502
+ <span class="liquid-width" id="createDescribeClose">Show &quot;close&quot; button:</span><input class="input-width-static" type="checkbox" name="closeButton" <?php echo $sgCloseButton;?> />
503
  <span class="dashicons dashicons-info CloseImg sameImageStyle"></span><span class="infoCloseButton samefontStyle">The popup will contain 'close' button.</span><br>
504
+
505
+ <span class="liquid-width">Enable content scrolling:</span><input class="input-width-static" type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
506
  <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the containt is larger then the specified dimentions, then the content will be scrollable.</span><br>
507
+
508
+ <span class="liquid-width">Enable responsiveness:</span><input class="input-width-static" type="checkbox" name="reposition" <?php echo $sgReposition;?> />
509
  <span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
510
+
511
+ <span class="liquid-width">Dismiss on overlay click:</span><input class="input-width-static" type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
512
  <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks beyond of the popup area.</span><br>
513
+
514
+ <span class="liquid-width">Dismiss on content click:</span><input class="input-width-static" type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
515
  <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
 
 
516
 
517
+ <span class="liquid-width">Change overlay color:</span><div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgOverlayColor" value="<?php echo esc_attr(@$sgOverlayColor); ?>" /></div><br>
518
+
519
+ <span class="liquid-width" id="createDescribeOpacitcy">Background overlay opacity:</span><div class="slider-wrapper">
520
  <input type="text" class="js-decimal" value="<?php echo esc_attr($sgOpacity);?>" rel="<?php echo esc_attr($sgOpacity);?>" name="opacity"/>
521
  <div id="js-display-decimal" class="display-box"></div>
522
+ </div><br>
523
+ <span class="liquid-width" id="createDescribeFixed">Popup location:</span><input class="input-width-static" type="checkbox" name="popupFixed" id="js-popup-fixed" <?php echo $sgPopupFixed;?> /><br>
524
+ <div class="js-popop-fixeds">
525
+ <span class="fix-wrapper-style" >&nbsp;</span>
526
+ <div class="fixed-wrapper">
527
+ <div class="js-fixed-position-style" id="fixed-position1" data-sgvalue="1"></div>
528
+ <div class="js-fixed-position-style" id="fixed-position2"data-sgvalue="2"></div>
529
+ <div class="js-fixed-position-style" id="fixed-position3" data-sgvalue="3"></div>
530
+ <div class="js-fixed-position-style" id="fixed-position4" data-sgvalue="4"></div>
531
+ <div class="js-fixed-position-style" id="fixed-position5" data-sgvalue="5"></div>
532
+ <div class="js-fixed-position-style" id="fixed-position6" data-sgvalue="6"></div>
533
+ <div class="js-fixed-position-style" id="fixed-position7" data-sgvalue="7"></div>
534
+ <div class="js-fixed-position-style" id="fixed-position8" data-sgvalue="8"></div>
535
+ <div class="js-fixed-position-style" id="fixed-position9" data-sgvalue="9"></div>
 
536
  </div>
537
  </div>
538
+ <input type="hidden" name="fixedPostion" class="js-fixed-postion" value="<?php echo esc_attr(@$sgFixedPostion);?>">
539
  </div>
540
  </div>
541
 
543
  </div>
544
  </div>
545
  </div>
546
+ <?php
547
  if (SG_POPUP_PRO) {
548
+ require_once("options_section/pro.php");
549
  }
550
  ?>
551
  </div>
552
  </div>
553
  <div class="clear"></div>
554
  <input type="hidden" class="button-primary" value="<?php echo esc_attr(@$id);?>" name="hidden_popup_number" />
555
+ </div>
556
  </div>
557
  </form>
files/sg_popup_main.php CHANGED
@@ -1,78 +1,74 @@
1
- <?php
2
-
3
- //Pagination::getLimit();
4
- $pagenum = isset($_GET['pn']) ? (int) $_GET['pn'] : 1;
5
-
6
- $limit = SG_APP_POPUP_TABLE_LIMIT;//;
7
- $offset = ($pagenum - 1) * $limit;
8
- $total = SGPopup::getTotalRowCount();
9
- $num_of_pages = ceil( esc_html($total) / $limit );
10
- if ($pagenum>$num_of_pages || $pagenum < 1) {
11
- $offset = 0;
12
- $pagenum = 1;
13
- }
14
- $orderBy = 'id DESC';
15
- $entries = SGPopup::findAll($orderBy,$limit,$offset);
16
- ?>
17
- <div class="wrap">
18
- <div class="headersWrapper">
19
- <h2>Popups <a href="<?php echo admin_url();?>admin.php?page=create-popup" class="add-new-h2">Add New</a></h2>
20
- <?php
21
- if(!SG_POPUP_PRO) { ?>
22
- <input type="button" class="mainUpdateToPro" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')">
23
- <?php }
24
- ?>
25
- </div>
26
- <table class="widefat">
27
- <thead>
28
- <tr>
29
- <th scope="col" class="manage-column column-name" style="">ID</th>
30
- <th scope="col" class="manage-column column-name" style="">Title</th>
31
- <th scope="col" class="manage-column column-name" style="">Type</th>
32
- <th scope="col" class="manage-column column-name" style="">Options</th>
33
- </tr>
34
- </thead>
35
- <tfoot>
36
- <tr>
37
- <th scope="col" class="manage-column column-name" style="">ID</th>
38
- <th scope="col" class="manage-column column-name" style="">Title</th>
39
- <th scope="col" class="manage-column column-name" style="">Type</th>
40
- <th scope="col" class="manage-column column-name" style="">Options</th>
41
- </tr>
42
- </tfoot>
43
- <tbody>
44
- <?php if($entries) { ?>
45
- <?php
46
- foreach( $entries as $entry ) { ?>
47
- <tr>
48
- <td><?php echo esc_html($entry->getId()); ?></td>
49
- <td><?php echo esc_html($entry->getTitle()); ?></td>
50
- <td><?php echo esc_html($entry->getType()); ?></td>
51
- <td><a href='<?php echo admin_url();?>admin.php?page=edit-popup&id=<?php echo esc_html($entry->getId());?>&type=<?php echo esc_html($entry->getType());?>'>Edit</a><a href="#" sg-app-popup-id = "<?php echo esc_html($entry->getId());?>" class='sgDeleteLink'>Delete</a></td>
52
- </tr>
53
- <?php }
54
- ?>
55
-
56
- <?php } else { ?>
57
- <tr>
58
- <td colspan="2">No popups</td>
59
- </tr>
60
- <?php } ?>
61
- </tbody>
62
- </table>
63
- <?php
64
-
65
- $page_links = paginate_links( array(
66
- 'base' => add_query_arg( 'pn', '%#%' ),
67
- 'format' => '',
68
- 'prev_text' => __( '&laquo;', 'aag' ),
69
- 'next_text' => __( '&raquo;', 'aag' ),
70
- 'total' => $num_of_pages,
71
- 'current' => $pagenum
72
-
73
- ));
74
- if ( $page_links ) {
75
- echo '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0">' . $page_links . '</div></div>';
76
- }
77
- ?>
78
  </div>
1
+ <?php
2
+ $pagenum = isset($_GET['pn']) ? (int) $_GET['pn'] : 1;
3
+
4
+ $limit = SG_APP_POPUP_TABLE_LIMIT;
5
+ $offset = ($pagenum - 1) * $limit;
6
+ $total = SGPopup::getTotalRowCount();
7
+ $num_of_pages = ceil(esc_html($total) / $limit);
8
+ if ($pagenum>$num_of_pages || $pagenum < 1) {
9
+ $offset = 0;
10
+ $pagenum = 1;
11
+ }
12
+ $orderBy = 'id DESC';
13
+ $entries = SGPopup::findAll($orderBy,$limit,$offset);
14
+ ?>
15
+ <div class="wrap">
16
+ <div class="headers-wrapper">
17
+ <h2>Popups <a href="<?php echo admin_url();?>admin.php?page=create-popup" class="add-new-h2">Add New</a></h2>
18
+ <?php if(!SG_POPUP_PRO): ?>
19
+ <input type="button" class="main-update-to-pro" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')">
20
+ <?php endif; ?>
21
+ </div>
22
+ <table class="widefat">
23
+ <thead>
24
+ <tr>
25
+ <th scope="col" class="manage-column column-name">ID</th>
26
+ <th scope="col" class="manage-column column-name title-max-width">Title</th>
27
+ <th scope="col" class="manage-column column-name">Type</th>
28
+ <th scope="col" class="manage-column column-name">Auto shortcode</th>
29
+ <th scope="col" class="manage-column column-name">Options</th>
30
+ </tr>
31
+ </thead>
32
+ <tfoot>
33
+ <tr>
34
+ <th scope="col" class="manage-column column-name">ID</th>
35
+ <th scope="col" class="manage-column column-name title-max-width">Title</th>
36
+ <th scope="col" class="manage-column column-name">Type</th>
37
+ <th scope="col" class="manage-column column-name">Auto shortcode</th>
38
+ <th scope="col" class="manage-column column-name">Options</th>
39
+ </tr>
40
+ </tfoot>
41
+ <tbody>
42
+ <?php if($entries) : ?>
43
+ <?php foreach($entries as $entry) : ?>
44
+ <tr>
45
+ <td><?php echo esc_html($entry->getId()); ?></td>
46
+ <td class="title-max-width"><?php echo esc_html($entry->getTitle()); ?></td>
47
+ <td><?php echo esc_html($entry->getType()); ?></td>
48
+ <td><?php echo "[sg_autoload_popup id=\"".esc_html($entry->getId())."\"]"; ?></td>
49
+ <td><a href='<?php echo admin_url();?>admin.php?page=edit-popup&id=<?php echo esc_html($entry->getId());?>&type=<?php echo esc_html($entry->getType());?>'>Edit</a><a href="#" data-sg-popup-id="<?php echo esc_html($entry->getId());?>" class="sg-js-delete-link">Delete</a></td>
50
+ </tr>
51
+ <?php endforeach; ?>
52
+ <?php else : ?>
53
+ <tr>
54
+ <td colspan="2">No popups</td>
55
+ </tr>
56
+ <?php endif; ?>
57
+ </tbody>
58
+ </table>
59
+ <?php
60
+
61
+ $pageLinks = paginate_links(array(
62
+ 'base' => add_query_arg('pn', '%#%'),
63
+ 'format' => '',
64
+ 'prev_text' => __('&laquo;', 'aag'),
65
+ 'next_text' => __('&raquo;', 'aag'),
66
+ 'total' => $num_of_pages,
67
+ 'current' => $pagenum
68
+
69
+ ));
70
+ if ($pageLinks) {
71
+ echo '<div class="tablenav"><div class="tablenav-pages">' . $pageLinks . '</div></div>';
72
+ }
73
+ ?>
 
 
 
 
74
  </div>
files/sg_popup_media_button.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function sgPopupMediaButton()
3
+ {
4
+ global $pagenow, $typenow;
5
+
6
+ $buttonTitle = 'Insert popup';
7
+ $output = '';
8
+
9
+ $pages = array(
10
+ 'post.php',
11
+ 'page.php',
12
+ 'post-new.php',
13
+ 'post-edit.php'
14
+ );
15
+
16
+ $checkPage = in_array(
17
+ $pagenow,
18
+ $pages
19
+ );
20
+
21
+ if ($checkPage && $typenow != 'download') {
22
+ $img = '<span class="dashicons dashicons-welcome-widgets-menus" id="sg-popup-media-button" style="padding: 3px 2px 0px 0px"></span>';
23
+ $output = '<a href="#TB_inline?width=600&height=550&inlineId=sg-popup-thickbox" class="thickbox button" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
24
+ }
25
+ echo $output;
26
+ }
27
+
28
+ add_action('media_buttons', 'sgPopupMediaButton', 11);
29
+
30
+ function sgPopupMediaButtonThickboxs()
31
+ {
32
+ global $pagenow, $typenow;
33
+
34
+ $pages = array(
35
+ 'post.php',
36
+ 'page.php',
37
+ 'post-new.php',
38
+ 'post-edit.php'
39
+ );
40
+
41
+ $checkPage = in_array(
42
+ $pagenow,
43
+ $pages
44
+ );
45
+
46
+ if ($checkPage && $typenow != 'download') : ?>
47
+ <script type="text/javascript">
48
+ jQuery(document).ready(function ($) {
49
+ $('#sg-ptp-popup-insert').on('click', function () {
50
+ var id = $('#sg-insert-popup-id').val();
51
+ if ('' === id) {
52
+ alert('Select your popup');
53
+ return;
54
+ }
55
+ selectionText = '';
56
+ if (typeof(tinyMCE.editors.content) != "undefined") {
57
+ selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : '';
58
+ }
59
+ window.send_to_editor('[sg_popup id="' + id + '"]'+selectionText+"[/sg_popup]");
60
+ });
61
+ });
62
+ </script>
63
+
64
+ <div id="sg-popup-thickbox" style="display: none;">
65
+ <div class="wrap">
66
+ <p>Insert the shortcode for showing a Popup.</p>
67
+ <div>
68
+ <select id="sg-insert-popup-id">
69
+ <option value="">Please select...</option>
70
+ <?php
71
+ global $wpdb;
72
+ $proposedTypes = array();
73
+ $orderBy = 'id DESC';
74
+ $allPopups = SGPopup::findAll($orderBy);
75
+ foreach ($allPopups as $allPopup) : ?>
76
+ <option value="<?=$allPopup->getId()?>"><?php echo $allPopup->getTitle();?><?php echo " - ".$allPopup->getType();?></option>;
77
+ <?php endforeach; ?>
78
+ </select>
79
+ </div>
80
+ <p class="submit">
81
+ <input type="button" id="sg-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="Insert"/>
82
+ <a id="sg_popup_cancel" class="button-secondary" onclick="tb_remove();" title="Cancel">Cancel</a>
83
+ </p>
84
+ </div>
85
+ </div>
86
+ <?php endif;
87
+ }
88
+
89
+ add_action('admin_footer', 'sgPopupMediaButtonThickboxs');
files/sg_popup_media_buuton.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
- function dh_popup_media_button() {
3
- global $pagenow, $typenow, $wp_version;
4
-
5
- $button_title = __('Insert popup');
6
- $output = '';
7
-
8
- // Show button only in post and page edit screens
9
- if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && $typenow != 'download' ) {
10
- /* check current WP version */
11
- $img = '<span class="dashicons dashicons-welcome-widgets-menus" id="dh-popup-media-button" style="padding: 3px 2px 0px 0px"></span>';
12
- $output = '<a href="#TB_inline?width=600&height=550&inlineId=sg-popup-thickbox" class="thickbox button" title="' . $button_title . '" style="padding-left: .4em;">' . $img . $button_title . '</a>';
13
- }
14
-
15
- echo $output;
16
- }
17
- add_action( 'media_buttons', 'dh_popup_media_button', 11);
18
-
19
- function dh_popup_media_button_thickboxs() {
20
- global $pagenow, $typenow, $post;
21
-
22
- // Only run in post/page creation and edit screens
23
- if ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) && $typenow != 'download' ) { ?>
24
-
25
- <script type="text/javascript">
26
- jQuery(document).ready(function ($) {
27
- $('#dh-ptp-popup-insert').on('click', function () {
28
- var id = $('#sg_popup_id').val();
29
-
30
- // Return early if no download is selected
31
- if ('' === id) {
32
- alert('Select your popup');
33
- return;
34
- }
35
- selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : 'Popup';
36
- window.send_to_editor('[sg_popup id="' + id + '"]'+selectionText+"[/sg_popup]");
37
-
38
- // Tracking
39
- jQuery.ajax({
40
- type: "POST",
41
- url: "<?php echo admin_url('admin-ajax.php'); ?>",
42
- data: {
43
- action: "dh_ptp_tracking_deploy",
44
- id: id
45
- }
46
- });
47
- });
48
- });
49
- </script>
50
-
51
- <div id="sg-popup-thickbox" style="display: none;" class="popupShortDiv">
52
- <div class="wrap" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">
53
- <p><?php echo 'Insert the shortcode for showing a Popup.'; ?></p>
54
- <div>
55
- <select id="sg_popup_id">
56
- <option value=""><?php echo 'Please select...'; ?></option>
57
- <?php
58
- global $wpdb;
59
- $proposedTypes = array();
60
- $orderBy = 'id DESC';
61
- $allPopups = SGPopup::findAll($orderBy);
62
- foreach($allPopups as $allPopup) { ?>
63
- <option value="<?=$allPopup->getId()?>"><?php echo $allPopup->getTitle();?><?php echo " - ".$allPopup->getType();?></option>;
64
- <?php } ?>
65
- </select>
66
- </div>
67
- <p class="submit">
68
- <input type="button" id="dh-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="<?php echo 'Insert'; ?>"/>
69
- <a id="sg_popup_cancel" class="button-secondary" onclick="tb_remove();" title="<?php echo 'Cancel'; ?>"><?php echo 'Cancel'; ?></a>
70
- </p>
71
- </div>
72
- </div>
73
- <?php
74
- }
75
- }
76
- add_action( 'admin_footer', 'dh_popup_media_button_thickboxs' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/sg_popup_page_selection.php CHANGED
@@ -1,45 +1,39 @@
1
  <?php
2
- function sg_popup_meta()
3
  {
4
- $screens = array( 'post', 'page' );
5
- foreach ( $screens as $screen )
6
- {
7
- add_meta_box( 'prfx_meta', __( 'Select popup on page load', 'prfx-textdomain' ), 'sg_popup_callback', $screen, 'normal' );
8
- }
9
  }
10
- add_action( 'add_meta_boxes', 'sg_popup_meta' );
11
 
12
- /**
13
- * Outputs the content of the meta box
14
- */
15
- function sg_popup_callback($post) {
16
  wp_nonce_field( basename( __FILE__ ), 'prfx_nonce' );
17
  $prfx_stored_meta = get_post_meta( $post->ID );
18
  ?>
19
- <p class="previewParagaraph">
20
- <?php
21
  global $wpdb;
22
  $proposedTypes = array();
23
  $orderBy = 'id DESC';
24
- $proposedTypes = SGPopup::findAll($orderBy);
25
- function createSelect($options,$name,$selecteOption) {
26
  $selected ='';
27
  $str = "";
28
- $str .= "<select class='choosePopupType promotionalPopupSelect' name=$name>";
29
  $str .= "<option value=''>Not selected</potion>";
30
  foreach($options as $option)
31
  {
32
- if($option)
33
- {
34
  $title = $option->getTitle();
35
  $type = $option->getType();
36
  $id = $option->getId();
37
- if($selecteOption == $id)
38
- {
39
  $selected = "selected";
40
  }
41
- else
42
- {
43
  $selected ='';
44
  }
45
  $str .= "<option value='".$id."' disable='".$id."' ".$selected." >$title - $type</potion>";
@@ -52,25 +46,23 @@ function sg_popup_callback($post) {
52
  $page = (int)$post->ID;
53
  $popup = "sg_promotional_popup";
54
  $popupId = SGPopup::getPagePopupId($page,$popup);
55
- echo createSelect($proposedTypes,'sg_promotional_popup',$popupId);
56
  $SG_APP_POPUP_URL = SG_APP_POPUP_URL;
57
  ?>
58
  </p>
59
-
60
  <input type="hidden" value="<?php echo $SG_APP_POPUP_URL;?>" id="SG_APP_POPUP_URL">
61
  <?php
62
  }
63
 
64
- function selectPopupSaved($post_id) {
 
65
  if(empty($_POST['sg_promotional_popup'])) {
66
- delete_post_meta($post_id, 'sg_promotional_popup');
67
- return false;
68
- }
69
- else {
70
- update_post_meta($post_id, 'sg_promotional_popup' , $_POST['sg_promotional_popup']);
71
- }
72
-
73
-
74
- }
75
 
76
- add_action('save_post','selectPopupSaved');
1
  <?php
2
+ function sgPopupMeta()
3
  {
4
+ $screens = array('post', 'page');
5
+ foreach ( $screens as $screen ) {
6
+ add_meta_box( 'prfx_meta', __('Select popup on page load', 'prfx-textdomain'), 'sgPopupCallback', $screen, 'normal');
7
+ }
 
8
  }
9
+ add_action('add_meta_boxes', 'sgPopupMeta');
10
 
11
+ function sgPopupCallback($post)
12
+ {
 
 
13
  wp_nonce_field( basename( __FILE__ ), 'prfx_nonce' );
14
  $prfx_stored_meta = get_post_meta( $post->ID );
15
  ?>
16
+ <p class="preview-paragaraph">
17
+ <?php
18
  global $wpdb;
19
  $proposedTypes = array();
20
  $orderBy = 'id DESC';
21
+ $proposedTypes = SGPopup::findAll($orderBy);
22
+ function sgCreateSelect($options,$name,$selecteOption) {
23
  $selected ='';
24
  $str = "";
25
+ $str .= "<select class=\"choose-popup-type\" name=\"$name\">";
26
  $str .= "<option value=''>Not selected</potion>";
27
  foreach($options as $option)
28
  {
29
+ if ($option) {
 
30
  $title = $option->getTitle();
31
  $type = $option->getType();
32
  $id = $option->getId();
33
+ if ($selecteOption == $id) {
 
34
  $selected = "selected";
35
  }
36
+ else {
 
37
  $selected ='';
38
  }
39
  $str .= "<option value='".$id."' disable='".$id."' ".$selected." >$title - $type</potion>";
46
  $page = (int)$post->ID;
47
  $popup = "sg_promotional_popup";
48
  $popupId = SGPopup::getPagePopupId($page,$popup);
49
+ echo sgCreateSelect($proposedTypes,'sg_promotional_popup',$popupId);
50
  $SG_APP_POPUP_URL = SG_APP_POPUP_URL;
51
  ?>
52
  </p>
 
53
  <input type="hidden" value="<?php echo $SG_APP_POPUP_URL;?>" id="SG_APP_POPUP_URL">
54
  <?php
55
  }
56
 
57
+ function sgSelectPopupSaved($post_id)
58
+ {
59
  if(empty($_POST['sg_promotional_popup'])) {
60
+ delete_post_meta($post_id, 'sg_promotional_popup');
61
+ return false;
62
+ }
63
+ else {
64
+ update_post_meta($post_id, 'sg_promotional_popup' , $_POST['sg_promotional_popup']);
65
+ }
66
+ }
 
 
67
 
68
+ add_action('save_post','sgSelectPopupSaved');
files/sg_popup_pro.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class SgPopupPro
3
+ {
4
+ public static function sgPopupDataSanitize($sgPopupData) {
5
+ $allowedHtmltags = wp_kses_allowed_html('post');
6
+ $allowedHtmltags['input'] = array('name'=>true, 'class'=>true, 'id'=>true, 'placeholder'=>true, 'title'=>true, 'value'=>true, 'type'=>true);
7
+ $allowedHtmltags['iframe'] = array('name'=>true, 'class'=>true, 'id'=>true, 'title'=>true, 'src'=>true, 'height'=>true, 'width'=>true);
8
+ return wp_kses($sgPopupData, $allowedHtmltags);
9
+ }
10
+ }
files/sg_popup_save.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('admin_post_save_popup', 'sgPopupSave');
3
+
4
+ function sgSanitize($optionsKey)
5
+ {
6
+ if (isset($_POST[$optionsKey])) {
7
+ if ($optionsKey == "sg_popup_html"||
8
+ $optionsKey == 'sg_ageRestriction'||
9
+ $optionsKey =='sg_countdown'||
10
+ $optionsKey =='iframe'||
11
+ $optionsKey =='sg_social') {
12
+ if(SG_POPUP_PRO) {
13
+ $sgPopupData = $_POST[$optionsKey];
14
+ require_once(SG_APP_POPUP_FILES ."/sg_popup_pro.php");
15
+ return SgPopupPro::sgPopupDataSanitize($sgPopupData);
16
+ }
17
+ return wp_kses_post($_POST[$optionsKey]);
18
+ }
19
+ return sanitize_text_field($_POST[$optionsKey]);
20
+ }
21
+ else {
22
+ return "";
23
+ }
24
+ }
25
+
26
+ function sgPopupSave()
27
+ {
28
+ global $wpdb;
29
+ $socialButtons = array();
30
+ $socialOptions = array();
31
+ $options = array();
32
+
33
+ $socialOptions = array(
34
+ 'sgSocialTheme' => sgSanitize('sgSocialTheme'),
35
+ 'sgSocialButtonsSize' => sgSanitize('sgSocialButtonsSize'),
36
+ 'sgSocialLabel' => sgSanitize('sgSocialLabel'),
37
+ 'sgSocialShareCount' => sgSanitize('sgSocialShareCount'),
38
+ 'sgRoundButton' => sgSanitize('sgRoundButton'),
39
+ 'fbShareLabel' => sgSanitize('fbShareLabel'),
40
+ 'lindkinLabel' => sgSanitize('lindkinLabel'),
41
+ 'sgShareUrl' => sgSanitize('sgShareUrl'),
42
+ 'shareUrlType' => sgSanitize('shareUrlType'),
43
+ 'googLelabel' => sgSanitize('googLelabel'),
44
+ 'twitterLabel' => sgSanitize('twitterLabel'),
45
+ 'pinterestLabel' => sgSanitize('pinterestLabel'),
46
+ 'sgMailSubject' => sgSanitize('sgMailSubject'),
47
+ 'sgMailLable' => sgSanitize('sgMailLable')
48
+ );
49
+
50
+ $socialButtons = array(
51
+ 'sgTwitterStatus' => sgSanitize('sgTwitterStatus'),
52
+ 'sgFbStatus' => sgSanitize('sgFbStatus'),
53
+ 'sgEmailStatus' => sgSanitize('sgEmailStatus'),
54
+ 'sgLinkedinStatus' => sgSanitize('sgLinkedinStatus'),
55
+ 'sgGoogleStatus' => sgSanitize('sgGoogleStatus'),
56
+ 'sgPinterestStatus' => sgSanitize('sgPinterestStatus')
57
+ );
58
+
59
+ $options = array(
60
+ 'width' => sgSanitize('width'),
61
+ 'height' => sgSanitize('height'),
62
+ 'delay' => (int)sgSanitize('delay'),
63
+ 'duration' => (int)sgSanitize('duration'),
64
+ 'effect' => sgSanitize('effect'),
65
+ 'escKey' => sgSanitize('escKey'),
66
+ 'scrolling' => sgSanitize('scrolling'),
67
+ 'reposition' => sgSanitize('reposition'),
68
+ 'overlayClose' => sgSanitize('overlayClose'),
69
+ 'contentClick' => sgSanitize('contentClick'),
70
+ 'opacity' => sgSanitize('opacity'),
71
+ 'sgOverlayColor' => sgSanitize('sgOverlayColor'),
72
+ 'popupFixed' => sgSanitize('popupFixed'),
73
+ 'fixedPostion' => sgSanitize('fixedPostion'),
74
+ 'maxWidth' => sgSanitize('maxWidth'),
75
+ 'maxHeight' => sgSanitize('maxHeight'),
76
+ 'initialWidth' => sgSanitize('initialWidth'),
77
+ 'initialHeight' => sgSanitize('initialHeight'),
78
+ 'closeButton' => sgSanitize('closeButton'),
79
+ 'theme' => sgSanitize('theme'),
80
+ 'onScrolling' => sgSanitize('onScrolling'),
81
+ 'beforeScrolingPrsent' => (int)sgSanitize('beforeScrolingPrsent'),
82
+ 'forMobile' => sgSanitize('forMobile'),
83
+ 'repeatPopup' => sgSanitize('repeatPopup'),
84
+ 'autoClosePopup' => sgSanitize('autoClosePopup'),
85
+ 'disablePopup' => sgSanitize('disablePopup'),
86
+ 'popupClosingTimer' => sgSanitize('popupClosingTimer'),
87
+ 'yesButtonLabel' => sgSanitize('yesButtonLabel'),
88
+ 'noButtonLabel' => sgSanitize('noButtonLabel'),
89
+ 'restrictionUrl' => sgSanitize('restrictionUrl'),
90
+ 'yesButtonBackgroundColor' => sgSanitize('yesButtonBackgroundColor'),
91
+ 'noButtonBackgroundColor' => sgSanitize('noButtonBackgroundColor'),
92
+ 'yesButtonTextColor' => sgSanitize('yesButtonTextColor'),
93
+ 'noButtonTextColor' => sgSanitize('noButtonTextColor'),
94
+ 'yesButtonRadius' => (int)sgSanitize('yesButtonRadius'),
95
+ 'noButtonRadius' => (int)sgSanitize('noButtonRadius'),
96
+ 'closingTime' => sgSanitize('closingTime'),
97
+ 'closeType' => sgSanitize('closeType'),
98
+ 'socialButtons' => json_encode($socialButtons),
99
+ 'socialOptions' => json_encode($socialOptions)
100
+ );
101
+ $html = stripslashes(sgSanitize("sg_popup_html"));
102
+ $ageRestriction = stripslashes(sgSanitize('sg_ageRestriction'));
103
+ $social = stripslashes(sgSanitize('sg_social'));
104
+ $image = sgSanitize('ad_image');
105
+ $countdown = stripslashes(sgSanitize('sg_countdown'));
106
+ $iframe = sgSanitize('iframe');
107
+ $video = sgSanitize('video');
108
+ $shortCode = stripslashes(sgSanitize('shortcode'));
109
+ $type = sgSanitize('type');
110
+ $title = sgSanitize('title');
111
+ $id = sgSanitize('hidden_popup_number');
112
+ $jsonDataArray = json_encode($options);
113
+
114
+ $data = array(
115
+ 'id' => $id,
116
+ 'title' => $title,
117
+ 'type' => $type,
118
+ 'image' => $image,
119
+ 'html' => $html,
120
+ 'iframe' => $iframe,
121
+ 'video' => $video,
122
+ 'shortcode' => $shortCode,
123
+ 'ageRestriction' => $ageRestriction,
124
+ 'countdown' => $countdown,
125
+ 'social' => $social,
126
+ 'options' => $jsonDataArray
127
+ );
128
+ if (empty($title)) {
129
+ wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&type=$type&titleError=1");
130
+ exit();
131
+ }
132
+ $popupName = "SG".ucfirst(strtolower($_POST['type']));
133
+ $popupClassName = $popupName."Popup";
134
+
135
+ require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
136
+
137
+ if ($id == "") {
138
+ global $wpdb;
139
+ call_user_func(array($popupClassName, 'create'), $data);
140
+ $lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
141
+ wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=".$lastId."&type=$type&saved=1");
142
+ exit();
143
+ }
144
+ else {
145
+ $popup = SGPopup::findById($id);
146
+ $popup->setTitle($title);
147
+ $popup->setId($id);
148
+ $popup->setType($type);
149
+ $popup->setOptions($jsonDataArray);
150
+
151
+ switch ($popupName) {
152
+ case 'SGImage':
153
+ $popup->setUrl($image);
154
+ break;
155
+ case 'SGIframe':
156
+ $popup->setUrl($iframe);
157
+ break;
158
+ case 'SGVideo':
159
+ $popup->setUrl($video);
160
+ $popup->setRealUrl($video);
161
+ break;
162
+ case 'SGHtml':
163
+ $popup->setContent($html);
164
+ break;
165
+ case 'SGShortcode':
166
+ $popup->setShortcode($shortCode);
167
+ break;
168
+ case 'SGAgerestriction':
169
+ $popup->setContent($ageRestriction);
170
+ $popup->setYesButton($options['yesButtonLabel']);
171
+ $popup->setNoButton($options['noButtonLabel']);
172
+ $popup->setRestrictionUrl($options['restrictionUrl']);
173
+ break;
174
+ case 'SGCountdown':
175
+ $popup->setCountdownContent($countdown);
176
+ $popup->setClosingTime($options['closingTime']);
177
+ $popup->setCloseType($options['closeType']);
178
+ break;
179
+ case 'SGSocial':
180
+ $popup->setSocialContent($social);
181
+ $popup->setButtons(json_encode($socialButtons));
182
+ $popup->setSocialOptions(json_encode($socialOptions));
183
+ break;
184
+ }
185
+
186
+ $popup->save();
187
+ wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=$id&type=$type&saved=1");
188
+ exit();
189
+ }
190
+ }
files/sg_popup_savePopupFrom.php DELETED
@@ -1,166 +0,0 @@
1
- <?php
2
- add_action('admin_post_save_popup', 'savePopupFrom');
3
-
4
- function setOptionvalue($optionsKey) {
5
-
6
- if(isset($_POST[$optionsKey]))
7
- {
8
- if($optionsKey == "sg_popup_html" || $optionsKey == 'sg_ageRestriction' || $optionsKey =='sg_countdown')
9
- {
10
- return wp_kses_post($_POST[$optionsKey]);
11
- }
12
-
13
- return sanitize_text_field($_POST[$optionsKey]);
14
- }
15
- else
16
- {
17
- return "";
18
- }
19
- }
20
-
21
- function savePopupFrom() {
22
-
23
- global $wpdb;
24
- $array = array();
25
- $socialButtons = array();
26
- $socialOptions = array();
27
-
28
- $array['width'] = setOptionvalue('width');
29
- $array['height'] = setOptionvalue('height');
30
- $array['delay'] = (int)setOptionvalue('delay');
31
- $array['duration'] = (int)setOptionvalue('duration');
32
- $array['effect'] = setOptionvalue('effect');
33
- $array['escKey'] = setOptionvalue('escKey');
34
- $array['scrolling'] = setOptionvalue('scrolling');
35
- $array['reposition'] = setOptionvalue('reposition');
36
- $array['overlayClose'] = setOptionvalue('overlayClose');
37
- $array['sgOverlayColor'] = setOptionvalue('sgOverlayColor');
38
- $array['contentClick'] = setOptionvalue('contentClick');
39
- $array['opacity'] = setOptionvalue('opacity');
40
- $array['popupFixed'] = setOptionvalue('popupFixed');
41
- $array['fixedPostion'] = setOptionvalue('fixedPostion');
42
- $array['maxWidth'] = setOptionvalue('maxWidth');
43
- $array['maxHeight'] = setOptionvalue('maxHeight');
44
- $array['initialWidth'] = setOptionvalue('initialWidth');
45
- $array['initialHeight'] = setOptionvalue('initialHeight');
46
- $array['closeButton'] = setOptionvalue('closeButton');
47
- $array['theme'] = setOptionvalue('theme');
48
- $array['onScrolling'] = setOptionvalue('onScrolling');
49
- $array['beforeScrolingPrsent'] = setOptionvalue('beforeScrolingPrsent');
50
- $array['forMobile'] = setOptionvalue('forMobile');
51
- $array['repeatPopup'] = setOptionvalue('repeatPopup');
52
- $array['countryStataus'] = setOptionvalue('countryStataus');
53
- $array['countryIso'] = setOptionvalue('countryIso');
54
- $array['countryName'] = setOptionvalue('countryName');
55
- $array['allowCountris'] = setOptionvalue('allowCountris');
56
- $array['autoClosePopup'] = setOptionvalue('autoClosePopup');
57
- $array['popupClosingTimer'] = setOptionvalue('popupClosingTimer');
58
- $array['disablePopup'] = setOptionvalue('disablePopup');
59
- $array['autoClosePopup'] = setOptionvalue('autoClosePopup');
60
- $array['popupClosingTimer'] = setOptionvalue('popupClosingTimer');
61
- $array['yesButtonLabel'] = setOptionvalue('yesButtonLabel');
62
- $array['noButtonLabel'] = setOptionvalue('noButtonLabel');
63
- $array['restrictionUrl'] = setOptionvalue('restrictionUrl');
64
- $array['yesButtonBackgroundColor'] = setOptionvalue('yesButtonBackgroundColor');
65
- $array['noButtonBackgroundColor'] = setOptionvalue('noButtonBackgroundColor');
66
- $array['yesButtonTextColor'] = setOptionvalue('yesButtonTextColor');
67
- $array['noButtonTextColor'] = setOptionvalue('noButtonTextColor');
68
- $array['yesButtonRadius'] = setOptionvalue('yesButtonRadius');
69
- $array['noButtonRadius'] = setOptionvalue('noButtonRadius');
70
- $array['restrictionAction'] = setOptionvalue('restrictionAction');
71
- $array['closingTime'] = setOptionvalue('closingTime');
72
- $array['closeType'] = setOptionvalue('closeType');
73
- $socialOptions['fbShareUrl']= setOptionvalue('fbShareUrl');
74
- $socialButtons['sgTwitterStatus'] = setOptionvalue('sgTwitterStatus');
75
- $socialButtons['sgFbStatus'] = setOptionvalue('sgFbStatus');
76
- $socialButtons['sgEmailStatus'] = setOptionvalue('sgEmailStatus');
77
- $socialButtons['sgLinkedinStatus'] = setOptionvalue('sgLinkedinStatus');
78
- $socialButtons['sgGoogleStatus'] = setOptionvalue('sgGoogleStatus');
79
- $socialButtons['sgPinterestStatus'] = setOptionvalue('sgPinterestStatus');
80
- $array['socialButtons'] = json_encode($socialButtons);
81
- $array['socialOptions'] = json_encode($socialOptions);
82
-
83
- $html = stripslashes(setOptionvalue("sg_popup_html"));
84
- $ageRestriction = stripslashes(setOptionvalue('sg_ageRestriction'));
85
- $social = stripslashes(setOptionvalue('sg_social'));
86
- $image = setOptionvalue('ad_image');
87
- $countdown = setOptionvalue('sg_countdown');
88
- $iframe = setOptionvalue('iframe');
89
- $video = setOptionvalue('video');
90
- $shortCode = stripslashes(setOptionvalue('shortCode'));
91
- $type = setOptionvalue('type');
92
- $title = setOptionvalue('title');
93
- $id = setOptionvalue('hidden_popup_number');
94
- $jsonDataArray = json_encode($array);
95
- $data = array(
96
- 'id'=>$id,
97
- 'title'=>$title,
98
- 'type'=>$type,
99
- 'image'=>$image,
100
- 'html'=>$html,
101
- 'iframe'=>$iframe,
102
- 'video'=>$video,
103
- 'shortcode'=>$shortCode,
104
- 'ageRestriction'=>$ageRestriction,
105
- 'countdown'=>$countdown,
106
- 'social'=> $social,
107
- 'options'=>$jsonDataArray
108
- );
109
- $popupName = "SG".ucfirst(strtolower($_POST['type']));
110
- $popupClassName = $popupName."Popup";
111
-
112
- require_once(SG_APP_POPUP_PATH ."/classes/".$popupClassName.".php");
113
-
114
- if($id == "") {
115
- global $wpdb;
116
- call_user_func(array($popupClassName, 'create'), $data);
117
- $lastId = $wpdb->get_var("SELECT LAST_INSERT_ID() FROM ". $wpdb->prefix."sg_popup");
118
- wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=".$lastId."&type=$type&saved=1");
119
- exit();
120
- }
121
- else {
122
- $popup = SGPopup::findById($id);
123
- $popup->setTitle($title);
124
- $popup->setId($id);
125
- $popup->setType($type);
126
- $popup->setOptions($jsonDataArray);
127
-
128
- switch ($popupName) {
129
- case 'SGImage':
130
- $popup->setUrl($image);
131
- break;
132
- case 'SGIframe':
133
- $popup->setUrl($iframe);
134
- break;
135
- case 'SGVideo':
136
- $popup->setUrl($video);
137
- $popup->setRealUrl($video);
138
- break;
139
- case 'SGHtml':
140
- $popup->setContent($html);
141
- break;
142
- case 'SGShortcode':
143
- $popup->setShortcode($shortCode);
144
- break;
145
- case 'SGAgerestriction':
146
- $popup->setContent($ageRestriction);
147
- $popup->setYesButton($array['yesButtonLabel']);
148
- $popup->setNoButton($array['noButtonLabel']);
149
- $popup->setRestrictionUrl($array['restrictionUrl']);
150
- break;
151
- case 'SGCountdown':
152
- $popup->setCountdownContent($social);
153
- $popup->setClosingTime($array['closingTime']);
154
- $popup->setCloseType($array['closeType']);
155
- break;
156
- case 'SGSocial':
157
- $popup->setSocialContent($social);
158
- $popup->setButtons(json_encode($socialButtons));
159
- $popup->setSocialOptions(json_encode($socialOptions));
160
- break;
161
- }
162
- $popup->save();
163
- wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=edit-popup&id=$id&type=$type&saved=1");
164
- exit();
165
- }
166
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
img/AgeRestriction.png DELETED
Binary file
img/Countdown.png DELETED
Binary file
img/default-image.png CHANGED
File without changes
img/down_arrow-2x.gif CHANGED
File without changes
img/info.png CHANGED
File without changes
img/pp_Icon.png CHANGED
File without changes
img/preview-eye.png ADDED
Binary file
img/socialPopup.png DELETED
Binary file
img/theme1.jpg CHANGED
File without changes
img/theme2.jpg CHANGED
File without changes
img/theme3.jpg CHANGED
File without changes
img/theme4.jpg CHANGED
File without changes
img/theme5.jpg CHANGED
File without changes
img/wpspin_light.gif CHANGED
File without changes
javascript/jquery.colorbox-min.js CHANGED
File without changes
javascript/sg_popup_backend.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function($){
2
  var custom_uploader;
3
  $('#upload_image_button').click(function(e)
4
  e.preventDefault();
5
  //If the uploader object has already been created, reopen the dialog
6
  if (custom_uploader)
7
  custom_uploader.open();
8
  return;
9
  }
10
  //Extend the wp.media object
11
  custom_uploader = wp.media.frames.file_frame = wp.media({
12
  titleFF: 'Choose Image',
13
  button: {
14
  text: 'Choose Image'
15
  },
16
  multiple: false
17
  });
18
  //When a file is selected, grab the URL and set it as the text field's value
19
  custom_uploader.on('select', function() {
20
  attachment = custom_uploader.state().get('selection').first().toJSON();
21
  $('#upload_image').val(attachment.url);
22
  });
23
  //Open the uploader dialog
24
  custom_uploader.open();
25
  });
26
  var currentAttrValue = jQuery(this).attr('href');
27
  // Show/Hide Tabs
28
  jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
29
  // Change/remove current tab to active
30
  jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
31
  e.preventDefault();
32
  });
 
 
1
  var custom_uploader;
2
  $('#upload_image_button').click(function(e)
3
  e.preventDefault();
4
  //If the uploader object has already been created, reopen the dialog
5
  if (custom_uploader)
6
  custom_uploader.open();
7
  return;
8
  }
9
  //Extend the wp.media object
10
  custom_uploader = wp.media.frames.file_frame = wp.media({
11
  titleFF: 'Choose Image',
12
  button: {
13
  text: 'Choose Image'
14
  },
15
  multiple: false
16
  });
17
  //When a file is selected, grab the URL and set it as the text field's value
18
  custom_uploader.on('select', function() {
19
  attachment = custom_uploader.state().get('selection').first().toJSON();
20
  $('#upload_image').val(attachment.url);
21
  });
22
  //Open the uploader dialog
23
  custom_uploader.open();
24
  });
25
  var currentAttrValue = jQuery(this).attr('href');
26
  // Show/Hide Tabs
27
  jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
28
  // Change/remove current tab to active
29
  jQuery(this).parent('li').removeClass('active').siblings().addClass('active');
30
  e.preventDefault();
31
  });
32
+ jQuery(document).ready(function($){
javascript/sg_popup_frontend.js CHANGED
@@ -1,46 +1,81 @@
1
- jQuery( document ).ready(function( $ ) {
2
- jQuery('[id=sg_colorbox_theme2-css]').remove();
3
- jQuery('[id=sg_colorbox_theme3-css]').remove();
4
- jQuery('[id=sg_colorbox_theme4-css]').remove();
5
- jQuery('[id=sg_colorbox_theme5-css]').remove();
6
- });
7
- jQuery(".sg-show-popup").bind('click',function() {
8
- var sgPopupID = jQuery(this).attr("data-sgpopupid");
9
- showPopup(sgPopupID,false);
10
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- function optionConvertBool(optionName) {
13
  returnValue = (optionName) ? true : false;
14
  return returnValue;
15
  }
16
- function canOpenPopup(id, openOnce, onLoad) {
17
- if (!onLoad) return true;
18
 
19
- if(typeof(sgPopup) !== 'undefined') {
20
-
21
- return sgPopup.canOpenOnce(id);
22
- }
23
-
 
 
 
24
 
25
  return true;
26
  }
27
- function checkVariebls(varieble) {
28
- if(varieble) {
29
- return varieble;
30
- }
31
- else {
32
- return '';
33
- }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
- function showPopup(id, onLoad) {
37
- var data = SG_POPUP_DATA[id];
38
 
39
- var openOnce = optionConvertBool(data['repeatPopup']);;
 
 
 
40
 
41
- if (!canOpenPopup(data['id'], openOnce, onLoad)) return;
 
 
 
 
 
 
 
 
 
 
42
 
43
- popupColorboxUrl = SG_APP_POPUP_URL+'/style/sgcolorbox/'+data['theme'];
44
  jQuery('[id=sg_colorbox_theme-css]').remove();
45
  head = document.getElementsByTagName('head')[0];
46
  link = document.createElement('link')
@@ -50,196 +85,196 @@ function showPopup(id, onLoad) {
50
  link.href = popupColorboxUrl;
51
  document.getElementsByTagName('head')[0].appendChild(link);
52
  var img = document.createElement('img');
53
- img.onerror = function(){
54
- showColorboxWithOptions();
55
- }
56
- img.src = popupColorboxUrl;
57
- function showColorboxWithOptions() {
58
-
59
- setTimeout(function() {
60
-
61
- sg_popup_popupFixed = optionConvertBool(data['popupFixed']);
62
- sg_popup_overlayClose = optionConvertBool(data['overlayClose']);
63
- sg_popup_contentClick = optionConvertBool(data['contentClick']);
64
- sg_popup_reposition = optionConvertBool(data['reposition']);
65
- sg_popup_scrolling = optionConvertBool(data['scrolling']);
66
- sg_popup_escKey = optionConvertBool(data['escKey']);
67
- sg_popup_closeButton = optionConvertBool(data['closeButton']);
68
- sg_popup_forMobile = optionConvertBool(data['forMobile']);
69
- sg_popup_cantClose = optionConvertBool(data['disablePopup']);
70
- sg_popup_autoClosePopup = optionConvertBool(data['autoClosePopup']);
71
- popupClosingTimer = data['popupClosingTimer'];
72
-
73
-
74
- if(sg_popup_cantClose) {
75
- sgPopup.cantPopupClose();
76
- }
77
- sg_popup_popupPosition = data['fixedPostion'];
78
- sg_popup_html = (data['html'] == '') ? '&nbsp;' : data['html'];
79
- sg_popup_image = data['image'];
80
- sg_popup_iframe_url = data['iframe'];
81
- sg_popup_shortCode = data['shortcode'];
82
- sg_popup_video = data['video'];
83
- sg_popup_overlayColor = data['sgOverlayColor'];
84
- sg_popup_width = data['width'];
85
- sg_popup_height = data['height'];
86
- sg_popup_ageRestriction = data['ageRestriction'];
87
- sg_popup_ageRestrictionUrl = data['restrictionUrl'];
88
- sg_pupup_yesButtonLabel = checkVariebls(data['yesButtonLabel']);
89
- sg_pupup_noButtonLabel = checkVariebls(data['noButtonLabel']);
90
- yesButtonBackgroundColor = checkVariebls(data['yesButtonBackgroundColor']);
91
- noButtonBackgroundColor = checkVariebls(data['noButtonBackgroundColor']);
92
- yesButtonTextColor = checkVariebls(data['yesButtonTextColor']);
93
- noButtonTextColor = checkVariebls(data['noButtonTextColor']);
94
- yesButtonRadius = checkVariebls(data['yesButtonRadius']);
95
- noButtonRadius = checkVariebls(data['noButtonRadius']);
96
-
97
-
98
- sg_popup_html = (sg_popup_html) ? sg_popup_html: false;
99
- sg_popup_iframe = (sg_popup_iframe_url) ? true: false;
100
- sg_popup_video = (sg_popup_video) ? sg_popup_video : false;
101
- sg_popup_image = (sg_popup_image) ? sg_popup_image : false;
102
- sg_popup_photo = (sg_popup_image) ? true : false;
103
- sg_popup_shortCode = (sg_popup_shortCode) ? sg_popup_shortCode : false;
104
- if(sg_popup_shortCode && sg_popup_html == false) {
105
- sg_popup_html = sg_popup_shortCode;
106
- }
107
- if(sg_popup_iframe_url) {
108
- sg_popup_image = sg_popup_iframe_url;
 
 
 
109
  }
110
- if(sg_popup_video) {
111
- if(sg_popup_width == '') sg_popup_width = '50%';
112
- if(sg_popup_height == '') sg_popup_height = '50%';
113
- sg_popup_iframe = true;
114
- sg_popup_image = sg_popup_video;
115
  }
 
 
 
116
 
117
- sg_popup_id = data['id'];
 
118
 
119
- if(sg_popup_popupFixed == true) {
120
- if(sg_popup_popupPosition == 1) {
121
- popupPositionTop = "3%";
122
- popupPositionBottom = false;
123
- popupPositionLeft = "0%";
124
- popupPositionRight = false;
125
- sgfixedPositonTop = 0;
126
- sgfixedPsotonleft = 0;
127
- }
128
-
129
- if(sg_popup_popupPosition == 3) {
130
- popupPositionTop = "3%";
131
- popupPositionBottom = false;
132
- popupPositionLeft = false;
133
- popupPositionRight = "0%";
134
- sgfixedPositonTop = 0;
135
- sgfixedPsotonleft = 90;
136
- }
137
- if(sg_popup_popupPosition == 5) {
138
- sg_popup_popupFixed = true;
139
- popupPositionTop = false;
140
- popupPositionBottom = false;
141
- popupPositionLeft = false;
142
- popupPositionRight = false;
143
- sgfixedPositonTop = 50;
144
- sgfixedPsotonleft = 50;
145
- }
146
- if(sg_popup_popupPosition == 7) {
147
- popupPositionTop = false;
148
- popupPositionBottom = "0%";
149
- popupPositionLeft = "0%";
150
- popupPositionRight = false;
151
- sgfixedPositonTop = 90;
152
- sgfixedPsotonleft = 0;
153
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
- if(sg_popup_popupPosition == 9) {
156
- popupPositionTop = false;
157
- popupPositionBottom = "0%";
158
- popupPositionLeft = false;
159
- popupPositionRight = "0%";
160
- sgfixedPositonTop = 90;
161
- sgfixedPsotonleft = 90;
162
  }
163
- }
164
- else {
165
- popupPositionTop = false;
166
- popupPositionBottom = false;
167
- popupPositionLeft = false;
168
- popupPositionRight = false;
169
- sgfixedPositonTop = 50;
170
- sgfixedPsotonleft = 50;
171
- }
172
- if(sg_popup_forMobile) {
173
- var userDevice = sgPopup.forMobile();
174
- }
175
- else {
176
- userDevice = false;
177
- }
178
- if(sg_popup_autoClosePopup) {
179
- sgPopup.cantPopupClose();
180
- setTimeout(autoClosePopup, popupClosingTimer*1000);
181
- function autoClosePopup() {
182
- sg_prmomotional_overlayClose = true;
183
- jQuery.sgcolorbox.close();
184
-
185
- }
186
- }
187
- if(userDevice) return;
188
-
189
- SG_POPUP_SETTINGS = {
190
- width: sg_popup_width,
191
- height: sg_popup_height,
192
- onOpen:function() {
193
- jQuery('#sgcolorbox').removeAttr('style');
194
- jQuery('#sgcolorbox').removeAttr('left');
195
- jQuery('#sgcolorbox').css('top',''+sgfixedPositonTop+'%');
196
- jQuery('#sgcolorbox').css('left',''+sgfixedPsotonleft+'%');
197
- jQuery('#sgcolorbox').css('animation-duration', data['duration']+"s");
198
- jQuery('#sgcolorbox').css('-webkit-animation-duration', data['duration']+"s");
199
- jQuery("#sgcolorbox").removeAttr("class");
200
- jQuery("#sgcolorbox").addClass('animated '+data['effect']+'');
201
- jQuery("#sgcboxOverlay").addClass("sgcboxOverlayBg");
202
- jQuery("#sgcboxOverlay").removeAttr('style');
203
- if(sg_popup_overlayColor) {
204
- jQuery("#sgcboxOverlay").css({'background' : 'none', 'background-color' : sg_popup_overlayColor});
205
- }
206
-
207
- },
208
- onLoad: function(){
209
- },
210
- html: sg_popup_html,
211
- photo: sg_popup_photo,
212
- iframe: sg_popup_iframe,
213
- href: sg_popup_image,
214
- opacity: data['opacity'],
215
- escKey: sg_popup_escKey,
216
- closeButton: sg_popup_closeButton,
217
- fixed: sg_popup_popupFixed,
218
- top: popupPositionTop,
219
- bottom: popupPositionBottom,
220
- left: popupPositionLeft,
221
- right: popupPositionRight,
222
- scrolling: sg_popup_scrolling,
223
- reposition: sg_popup_reposition,
224
- overlayClose: sg_popup_overlayClose,
225
- maxWidth: data['maxWidth'],
226
- maxHeight: data['maxHeight'],
227
- initialWidth: data['initialWidth'],
228
- initialHeight: data['initialHeight']
229
- };
230
-
231
- jQuery.sgcolorbox(SG_POPUP_SETTINGS);
232
-
233
- if(data['id'] && onLoad==true && openOnce != '') {
234
- jQuery.cookie("sgPopupNumbers",data['id'], { expires: 7});
235
- }
236
-
237
- if(sg_popup_contentClick) {
238
- jQuery('#sgcolorbox').bind('click',function() {
239
- jQuery.sgcolorbox.close();
240
- });
241
- }
242
 
243
- },data['delay']*1000);
244
- }
245
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function SGPopup() {
2
+ this.positionLeft = '';
3
+ this.positionTop = '';
4
+ this.positionBottom = '';
5
+ this.positionRight = '';
6
+ this.initialPositionTop = '';
7
+ this.initialPositionLeft = '';
8
+ this.isOnLoad = '';
9
+ this.openOnce = '';
10
+ this.popupData = new Array();
11
+ this.popupEscKey = true;
12
+ this.popupOverlayClose = true;
13
+ this.popupContentClick = false;
14
+ this.popupCloseButton = true;
15
+ }
16
+
17
+ SGPopup.prototype.init = function() {
18
+ var that = this;
19
+ jQuery('[id=sg_colorbox_theme2-css]').remove();
20
+ jQuery('[id=sg_colorbox_theme3-css]').remove();
21
+ jQuery('[id=sg_colorbox_theme4-css]').remove();
22
+ jQuery('[id=sg_colorbox_theme5-css]').remove();
23
+
24
+ jQuery(".sg-show-popup").bind('click',function() {
25
+ var sgPopupID = jQuery(this).attr("data-sgpopupid");
26
+ that.showPopup(sgPopupID,false);
27
+ });
28
+ }
29
 
30
+ SGPopup.prototype.varToBool = function(optionName) {
31
  returnValue = (optionName) ? true : false;
32
  return returnValue;
33
  }
 
 
34
 
35
+ SGPopup.prototype.canOpenPopup = function(id, openOnce, isOnLoad) {
36
+ if (!isOnLoad) {
37
+ return true;
38
+ }
39
+ if(openOnce) {
40
+ return this.canOpenOnce(id);
41
+ }
42
+
43
 
44
  return true;
45
  }
 
 
 
 
 
 
 
46
 
47
+ SGPopup.prototype.setFixedPosition = function(sgPositionLeft, sgPositionTop, sgPositionBottom, sgPositionRight, sgFixedPositionTop, sgFixedPositionLeft) {
48
+ this.positionLeft = sgPositionLeft;
49
+ this.positionTop = sgPositionTop;
50
+ this.positionBottom = sgPositionBottom;
51
+ this.positionRight = sgPositionRight;
52
+ this.initialPositionTop = sgFixedPositionTop;
53
+ this.initialPositionLeft = sgFixedPositionLeft;
54
+ }
55
+
56
+ SGPopup.prototype.percentToPx = function(percentDimention, screenDimension) {
57
+ var dimension = parseInt(percentDimention)*screenDimension/100;
58
+ return dimension;
59
  }
 
 
60
 
61
+ SGPopup.prototype.getPositionPercent = function(needPercent, screenDimension, dimension) {
62
+ var sgPosition = (((this.percentToPx(needPercent,screenDimension)-dimension/2)/screenDimension)*100)+"%";
63
+ return sgPosition;
64
+ }
65
 
66
+ SGPopup.prototype.showPopup = function(id, isOnLoad) {
67
+ var that = this;
68
+ this.popupData = SG_POPUP_DATA[id];
69
+ this.isOnLoad = isOnLoad;
70
+ this.openOnce = this.varToBool(this.popupData['repeatPopup']);
71
+ if (this.openOnce === false) {
72
+ jQuery.removeCookie("sgPopupNumbers");
73
+ }
74
+ if (!this.canOpenPopup(this.popupData['id'], this.openOnce, isOnLoad)) {
75
+ return;
76
+ }
77
 
78
+ popupColorboxUrl = SG_APP_POPUP_URL+'/style/sgcolorbox/'+this.popupData['theme'];
79
  jQuery('[id=sg_colorbox_theme-css]').remove();
80
  head = document.getElementsByTagName('head')[0];
81
  link = document.createElement('link')
85
  link.href = popupColorboxUrl;
86
  document.getElementsByTagName('head')[0].appendChild(link);
87
  var img = document.createElement('img');
88
+ img.onerror = function() {
89
+ that.sgShowColorboxWithOptions();
90
+ }
91
+ img.src = popupColorboxUrl;
92
+
93
+ }
94
+
95
+ SGPopup.prototype.sgShowColorboxWithOptions = function() {
96
+ var that = this;
97
+ setTimeout(function() {
98
+
99
+ sgPopupFixed = that.varToBool(that.popupData['popupFixed']);
100
+ that.popupOverlayClose = that.varToBool(that.popupData['overlayClose']);
101
+ that.popupContentClick = that.varToBool(that.popupData['contentClick']);
102
+ var popupReposition = that.varToBool(that.popupData['reposition']);
103
+ var popupScrolling = that.varToBool(that.popupData['scrolling']);
104
+ that.popupEscKey = that.varToBool(that.popupData['escKey']);
105
+ that.popupCloseButton = that.varToBool(that.popupData['closeButton']);
106
+ var popupForMobile = that.varToBool(that.popupData['forMobile']);
107
+ var popupCantClose = that.varToBool(that.popupData['disablePopup']);
108
+ var popupAutoClosePopup = that.varToBool(that.popupData['autoClosePopup']);
109
+ popupClosingTimer = that.popupData['popupClosingTimer'];
110
+
111
+
112
+ if (popupCantClose) {
113
+ that.cantPopupClose();
114
+ }
115
+ var popupPosition = that.popupData['fixedPostion'];
116
+ var popupHtml = (that.popupData['html'] == '') ? '&nbsp;' : that.popupData['html'];
117
+ var popupImage = that.popupData['image'];
118
+ var popupIframeUrl = that.popupData['iframe'];
119
+ var popupShortCode = that.popupData['shortcode'];
120
+ var popupVideo = that.popupData['video'];
121
+ var popupOverlayColor = that.popupData['sgOverlayColor'];
122
+ var popupWidth = that.popupData['width'];
123
+ var popupHeight = that.popupData['height'];
124
+ var popupOpacity = that.popupData['opacity'];
125
+ var popupMaxWidth = that.popupData['maxWidth'];
126
+ var popupMaxHeight = that.popupData['maxHeight'];
127
+ var popupInitialWidth = that.popupData['initialWidth'];
128
+ var popupInitialHeight = that.popupData['initialHeight'];
129
+ var popupEffectDuration = that.popupData['duration'];
130
+ var popupEffect = that.popupData['effect'];
131
+
132
+ popupHtml = (popupHtml) ? popupHtml : false;
133
+ var popupIframe = (popupIframeUrl) ? true: false;
134
+ popupVideo = (popupVideo) ? popupVideo : false;
135
+ popupImage = (popupImage) ? popupImage : false;
136
+ var popupPhoto = (popupImage) ? true : false;
137
+ popupShortCode = (popupShortCode) ? popupShortCode : false;
138
+ if (popupShortCode && popupHtml == false) {
139
+ popupHtml = popupShortCode;
140
+ }
141
+ if (popupIframeUrl) {
142
+ popupImage = popupIframeUrl;
143
+ }
144
+ if (popupVideo) {
145
+ if (popupWidth == '') {
146
+ popupWidth = '50%';
147
  }
148
+ if (popupHeight == '') {
149
+ popupHeight = '50%';
 
 
 
150
  }
151
+ popupIframe = true;
152
+ popupImage = popupVideo;
153
+ }
154
 
155
+ var sgScreenWidth = jQuery(window).width();
156
+ var sgScreenHeight = jQuery(window).height();
157
 
158
+ var sgIsWidthInPercent = popupWidth.indexOf("%");
159
+ var sgIsHeightInPercent = popupHeight.indexOf("%");
160
+ var sgPopupHeightPx = popupHeight;
161
+ var sgPopupWidthPx = popupWidth;
162
+ if (sgIsWidthInPercent != -1) {
163
+ sgPopupWidthPx = that.percentToPx(popupWidth, sgScreenWidth);
164
+ }
165
+ if (sgIsHeightInPercent != -1) {
166
+ sgPopupHeightPx = that.percentToPx(popupHeight, sgScreenHeight);
167
+ }
168
+ popupPositionTop = that.getPositionPercent("50%", sgScreenHeight, sgPopupHeightPx);
169
+ popupPositionLeft = that.getPositionPercent("50%", sgScreenWidth, sgPopupWidthPx);
170
+
171
+ if(popupPosition == 1) { // Left Top
172
+ that.setFixedPosition('0%','3%', false, false, 0, 0);
173
+ }
174
+ else if(popupPosition == 2) { // Left Top
175
+ that.setFixedPosition(popupPositionLeft,'3%', false, false, 0, 50);
176
+ }
177
+ else if(popupPosition == 3) { //Right Top
178
+ that.setFixedPosition(false,'3%', false, '0%', 0, 90);
179
+ }
180
+ else if(popupPosition == 4) { // Left Center
181
+ that.setFixedPosition('0%', popupPositionTop, false, false, popupPositionTop, 0);
182
+ }
183
+ else if(popupPosition == 5) { // center Center
184
+ sgPopupFixed = true;
185
+ that.setFixedPosition(false, false, false, false, 50, 50);
186
+ }
187
+ else if(popupPosition == 6) { // Right Center
188
+ that.setFixedPosition('0%', popupPositionTop, false,'0%', 50, 90);
189
+ }
190
+ else if(popupPosition == 7) { // Left Bottom
191
+ that.setFixedPosition('0%', false, '0%', false, 90, 0);
192
+ }
193
+ else if(popupPosition == 8) { // Center Bottom
194
+ that.setFixedPosition(popupPositionLeft, false, '0%', false, 90, 50);
195
+ }
196
+ else if(popupPosition == 9) { // Right Bottom
197
+ that.setFixedPosition(false, false, '0%', '0%', 90, 90);
198
+ }
199
+ else {
200
+ that.setFixedPosition(false, false, false, false, 50, 50);
201
+ }
202
+ var userDevice = false;
203
+ if (popupForMobile) {
204
+ userDevice = that.forMobile();
205
+ }
206
+
207
+ if (popupAutoClosePopup) {
208
+ that.cantPopupClose();
209
+ setTimeout(that.autoClosePopup, popupClosingTimer*1000);
210
+ }
211
+
212
+ if (userDevice) {
213
+ return;
214
+ }
215
+
216
+ SG_POPUP_SETTINGS = {
217
+ width: popupWidth,
218
+ height: popupHeight,
219
+ onOpen:function() {
220
+ jQuery('#sgcolorbox').removeAttr('style');
221
+ jQuery('#sgcolorbox').removeAttr('left');
222
+ jQuery('#sgcolorbox').css('top',''+that.initialPositionTop+'%');
223
+ jQuery('#sgcolorbox').css('left',''+that.initialPositionLeft+'%');
224
+ jQuery('#sgcolorbox').css('animation-duration', popupEffectDuration+"s");
225
+ jQuery('#sgcolorbox').css('-webkit-animation-duration', popupEffectDuration+"s");
226
+ jQuery("#sgcolorbox").removeAttr("class");
227
+ jQuery("#sgcolorbox").addClass('animated '+popupEffect+'');
228
+ jQuery("#sgcboxOverlay").addClass("sgcboxOverlayBg");
229
+ jQuery("#sgcboxOverlay").removeAttr('style');
230
+ if (popupOverlayColor) {
231
+ jQuery("#sgcboxOverlay").css({'background' : 'none', 'background-color' : popupOverlayColor});
232
  }
233
+ },
234
+ onLoad: function(){
235
+ },
236
+ onComplete: function(){
237
+ //Contact form 7
238
+ if(jQuery('div.wpcf7 > form').length) {
239
+ jQuery('div.wpcf7 > form').wpcf7InitForm();
240
  }
241
+ },
242
+ html: popupHtml,
243
+ photo: popupPhoto,
244
+ iframe: popupIframe,
245
+ href: popupImage,
246
+ opacity: popupOpacity,
247
+ escKey: that.popupEscKey,
248
+ closeButton: that.popupCloseButton,
249
+ fixed: sgPopupFixed,
250
+ top: that.positionTop,
251
+ bottom: that.positionBottom,
252
+ left: that.positionLeft,
253
+ right: that.positionRight,
254
+ scrolling: popupScrolling,
255
+ reposition: popupReposition,
256
+ overlayClose: that.popupOverlayClose,
257
+ maxWidth: popupMaxWidth,
258
+ maxHeight: popupMaxHeight,
259
+ initialWidth: popupInitialWidth,
260
+ initialHeight: popupInitialHeight
261
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
 
263
+ jQuery.sgcolorbox(SG_POPUP_SETTINGS);
264
+
265
+ if (that.popupData['id'] && that.isOnLoad==true && that.openOnce != '') {
266
+ jQuery.cookie("sgPopupNumbers",that.popupData['id'], { expires: 7});
267
+ }
268
+
269
+ if (that.popupContentClick) {
270
+ jQuery('#sgcolorbox').bind('click',function() {
271
+ jQuery.sgcolorbox.close();
272
+ });
273
+ }
274
+ },this.popupData['delay']*1000);
275
+ }
276
+
277
+ jQuery(document).ready(function($) {
278
+ var popupObj = new SGPopup();
279
+ popupObj.init();
280
+ });
javascript/sg_popup_javascript.php CHANGED
@@ -1,51 +1,48 @@
1
- <?php
2
-
3
- function sg_set_admin_url($hook) {
4
- if ('popup-builder_page_create-popup' == $hook) {
5
- echo '<script type="text/javascript">SG_ADMIN_URL = "'.admin_url()."admin.php?page=create-popup".'";</script>';
6
- }
7
- }
8
-
9
- function sg_popup_admin_scripts($hook) {
10
-
11
- if ( 'popup-builder_page_edit-popup' == $hook || 'popup-builder_page_create-popup' == $hook ) {
12
-
13
- wp_enqueue_media();
14
- wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
15
- wp_enqueue_script('jquery');
16
- wp_enqueue_script('javascript');
17
-
18
- }
19
- else if('toplevel_page_PopupBuilder' == $hook){
20
- wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
21
- wp_enqueue_script('javascript');
22
- wp_enqueue_script('jquery');
23
- }
24
- if('popup-builder_page_edit-popup' == $hook) {
25
- wp_register_script('sg_popup_rangeslider', SG_APP_POPUP_URL . '/javascript/sg_popup_rangeslider.js', array('jquery'));
26
- wp_register_script('sg_popup_tagsinput', SG_APP_POPUP_URL . '/javascript/bootstrap-tagsinput.js', array('jquery'));
27
- wp_enqueue_script('sg_popup_rangeslider');
28
- wp_enqueue_script('sg_popup_tagsinput');
29
- wp_enqueue_script('jquery');
30
- }
31
- }
32
- add_action('admin_enqueue_scripts', 'sg_set_admin_url');
33
- add_action('admin_enqueue_scripts', 'sg_popup_admin_scripts');
34
-
35
- function sg_popup_scripts($hook) {
36
- if ($hook != 'post.php') {
37
- return;
38
- }
39
- wp_enqueue_media();
40
- wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
41
- wp_register_script('colorbox', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'));
42
- if(SG_POPUP_PRO) {
43
- wp_register_script('proo', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js');
44
- wp_enqueue_script('proo');
45
- }
46
- wp_enqueue_script('jquery');
47
- wp_enqueue_script('colorbox');
48
- wp_enqueue_script('javascript');
49
- }
50
- add_action('admin_enqueue_scripts', 'sg_popup_scripts');
51
-
1
+ <?php
2
+
3
+ function sg_set_admin_url($hook) {
4
+ if ('popup-builder_page_create-popup' == $hook) {
5
+ echo '<script type="text/javascript">SG_ADMIN_URL = "'.admin_url()."admin.php?page=create-popup".'";</script>';
6
+ }
7
+ }
8
+
9
+ function sg_popup_admin_scripts($hook) {
10
+
11
+ if ( 'popup-builder_page_edit-popup' == $hook || 'popup-builder_page_create-popup' == $hook ) {
12
+
13
+ wp_enqueue_media();
14
+ wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
15
+ wp_enqueue_script('jquery');
16
+ wp_enqueue_script('javascript');
17
+
18
+ }
19
+ else if('toplevel_page_PopupBuilder' == $hook){
20
+ wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
21
+ wp_enqueue_script('javascript');
22
+ wp_enqueue_script('jquery');
23
+ }
24
+ if('popup-builder_page_edit-popup' == $hook) {
25
+ wp_register_script('sg_popup_rangeslider', SG_APP_POPUP_URL . '/javascript/sg_popup_rangeslider.js', array('jquery'));
26
+ wp_register_script('sg_popup_tagsinput', SG_APP_POPUP_URL . '/javascript/bootstrap-tagsinput.js', array('jquery'));
27
+ wp_enqueue_script('sg_popup_rangeslider');
28
+ wp_enqueue_script('sg_popup_tagsinput');
29
+ wp_enqueue_script('jquery');
30
+
31
+ }
32
+ }
33
+ add_action('admin_enqueue_scripts', 'sg_set_admin_url');
34
+ add_action('admin_enqueue_scripts', 'sg_popup_admin_scripts');
35
+
36
+ function sg_popup_scripts($hook) {
37
+ if ($hook != 'post.php') {
38
+ return;
39
+ }
40
+ wp_enqueue_media();
41
+ wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
42
+ wp_register_script('colorbox', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'));
43
+ wp_enqueue_script('jquery');
44
+ wp_enqueue_script('colorbox');
45
+ wp_enqueue_script('javascript');
46
+ }
47
+ add_action('admin_enqueue_scripts', 'sg_popup_scripts');
48
+
 
 
 
javascript/sg_popup_rangeslider.js CHANGED
File without changes
popup-builder.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: http://sygnoos.com
5
- * Description: Create and manage powerful promotion popups for your WordPress blog or website. It's completely free and all features are available.
6
- * Version: 2.0.4
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
@@ -18,7 +18,7 @@ define('SG_APP_POPUP_FILES', SG_APP_POPUP_PATH . '/files');
18
  define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
19
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
20
  define('SG_APP_POPUP_TABLE_LIMIT', 20 );
21
- define('SG_POPUP_VERSION', 2.04);
22
  define('SG_POPUP_PRO', 0);
23
  define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
24
 
@@ -29,79 +29,102 @@ $POPUP_TITLES = array(
29
  'video' => 'Video',
30
  'shortcode' => 'Shortcode',
31
  'ageRestriction' => 'Age Restriction',
32
- 'countdown' => 'Countdown'
 
33
  );
34
 
35
- require_once( SG_APP_POPUP_CLASSES .'/SGPopup.php');
36
  require_once( SG_APP_POPUP_CLASSES .'/PopupInstaller.php'); //cretae tables
37
- if(SG_POPUP_PRO) require_once( SG_APP_POPUP_CLASSES .'/PopupProInstaller.php'); //uninstall tables
 
 
38
  require_once( SG_APP_POPUP_PATH .'/style/sg_popup_style.php' ); //include our css file
39
  require_once( SG_APP_POPUP_JS .'/sg_popup_javascript.php' ); //include our js file
40
  require_once( SG_APP_POPUP_FILES .'/sg_popup_page_selection.php' ); // include here in page button for select popup every page
41
 
42
- register_activation_hook(__FILE__, 'sg_popup_activate');
43
- register_uninstall_hook(__FILE__, 'sg_popup_deactivate');
44
- //register_deactivation_hook(__FILE__, 'sg_popup_deactivate');
45
 
46
 
47
- add_action('wpmu_new_blog', 'wporg_wpmu_new_blogPopup', 10, 6 );
48
 
49
- function wporg_wpmu_new_blogPopup() {
 
50
  PopupInstaller::install();
51
- if(SG_POPUP_PRO) PopupProInstaller::install();
 
 
52
  }
53
- function sg_popup_activate() {
54
- update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
 
 
55
  PopupInstaller::install();
56
- if(SG_POPUP_PRO) PopupProInstaller::install();
 
 
57
  }
58
 
59
- function sg_popup_deactivate() {
60
- delete_option('SG_POPUP_VERSION');
 
61
  PopupInstaller::uninstall();
62
- if(SG_POPUP_PRO) PopupProInstaller::uninstall();
 
 
63
  }
64
 
65
 
66
  add_action("admin_menu","sgAddMenu");
67
- function sgAddMenu() {
 
68
  add_menu_page("Popup Builder", "Popup Builder", "manage_options","PopupBuilder","sgPopupMenu","dashicons-welcome-widgets-menus");
69
  add_submenu_page("PopupBuilder", "All Popups", "All Popups", 'manage_options', "PopupBuilder", "sgPopupMenu");
70
  add_submenu_page("PopupBuilder", "Add New", "Add New", 'manage_options', "create-popup", "sgCreatePopup");
71
- add_submenu_page("PopupBuilder", "Edit Popup", "Edit Popup", 'manage_options', "edit-popup", "sgEditPopup");
72
  }
73
 
74
- function sgPopupMenu() {
 
75
  require_once( SG_APP_POPUP_FILES . '/sg_popup_main.php');
76
  }
77
 
78
- function sgCreatePopup() {
79
- require_once( SG_APP_POPUP_FILES . '/sg_popup_create.php'); // here is inculde file in the first sub menu
 
80
  }
81
 
82
- function sgEditPopup() {
 
83
  require_once( SG_APP_POPUP_FILES . '/sg_popup_create_new.php');
84
  }
85
 
86
- function sgRegisterScripts() {
 
87
  SGPopup::$registeredScripts = true;
88
- wp_register_style('sg_animate', SG_APP_POPUP_URL . '/style/animate.css');
89
  wp_enqueue_style('sg_animate');
90
  wp_register_script('sg_popup_frontend', SG_APP_POPUP_URL . '/javascript/sg_popup_frontend.js', array('jquery'));
91
  wp_enqueue_script('sg_popup_frontend');
92
  wp_enqueue_script('jquery');
93
  wp_register_script('sg_cookie', SG_APP_POPUP_URL . '/javascript/jquery.cookie.js', array('jquery'));
94
  wp_enqueue_script('sg_cookie');
95
- wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'), '5.0');
96
  wp_enqueue_script('sg_colorbox');
97
- if(SG_POPUP_PRO) {
98
- echo "<script type='text/javascript' src = ".SG_APP_POPUP_URL."/javascript/sg_popup_pro.js?ver=4.2.3'></script>";
 
 
99
  }
100
  echo "<script type='text/javascript'>SG_POPUP_DATA = [];SG_APP_POPUP_URL = '".SG_APP_POPUP_URL."';</script>";
101
  }
102
 
103
- function sgRenderPopupScript($id) {
104
- if (SGPopup::$registeredScripts==false) sgRegisterScripts();
 
 
 
105
  wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox1.css");
106
  wp_register_style('sg_colorbox_theme2', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox2.css");
107
  wp_register_style('sg_colorbox_theme3', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox3.css");
@@ -115,56 +138,85 @@ function sgRenderPopupScript($id) {
115
  sgFindPopupData($id);
116
  }
117
 
118
- function sgFindPopupData($id) {
 
119
  $obj = SGPopup::findById($id);
120
- if(!empty($obj)) $content = $obj->render();
 
 
121
  echo "<script type='text/javascript'>";
122
  echo $content;
123
  echo "</script>";
124
  }
125
 
126
- function sgShowShortCode($args, $content) {
 
127
  $obj = SGPopup::findById($args['id']);
128
- wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/".@$options['theme']."");
129
- wp_enqueue_style('sg_colorbox_theme');
130
- if(!$obj) return $content;
 
131
  sgRenderPopupScript($args['id']);
132
  return "<a href='javascript:void(0)' class='sg-show-popup' data-sgpopupid=".$args['id'].">".$content."</a>";
 
 
 
 
133
  }
134
  add_shortCode('sg_popup', 'sgShowShortCode');
135
 
136
- function sgOnloadPopup() {
137
- $page = get_queried_object_id ();
138
- $popup = "sg_promotional_popup";
139
- $popupId = SGPopup::getPagePopupId($page,$popup);
140
- if(!$popupId) return;
 
 
 
 
 
 
141
  sgRenderPopupScript($popupId);
142
  echo "<script>window.onload = function() {
143
  sgOnScrolling = (SG_POPUP_DATA [$popupId]['onScrolling']) ? SG_POPUP_DATA [$popupId]['onScrolling']: ''; ;
144
  beforeScrolingPrsent = (SG_POPUP_DATA [$popupId]['onScrolling']) ? SG_POPUP_DATA [$popupId]['beforeScrolingPrsent']: '';
145
  autoClosePopup = (SG_POPUP_DATA [$popupId]['autoClosePopup']) ? SG_POPUP_DATA [$popupId]['autoClosePopup']: '';
146
  popupClosingTimer = (SG_POPUP_DATA [$popupId]['popupClosingTimer']) ? SG_POPUP_DATA [$popupId]['popupClosingTimer']: '';
 
147
  if(sgOnScrolling) {
148
- sgPopup.onScrolling($popupId);
149
- }
150
  else {
151
- showPopup($popupId,true);
 
152
  }
153
  }
154
  </script>";
 
155
 
 
 
 
 
 
 
 
 
 
156
  }
 
157
  add_action('wp_head','sgOnloadPopup');
158
- require_once( SG_APP_POPUP_FILES . '/sg_popup_media_buuton.php');
159
- require_once( SG_APP_POPUP_FILES . '/sg_popup_savePopupFrom.php'); // saving form data
160
  require_once( SG_APP_POPUP_FILES . '/sg_popup_ajax.php');
161
 
162
- function sg_popup_plugin_loaded() {
163
- $versionPopup = get_option('SG_POPUP_VERSION');
164
- if(!$versionPopup || $versionPopup < SG_POPUP_VERSION ) {
165
- update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
166
- PopupInstaller::install();
167
- PopupInstaller::convert();
168
- }
169
  }
170
- add_action( 'plugins_loaded', 'sg_popup_plugin_loaded' );
 
2
  /**
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: http://sygnoos.com
5
+ * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 2.0.5
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
18
  define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
19
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
20
  define('SG_APP_POPUP_TABLE_LIMIT', 20 );
21
+ define('SG_POPUP_VERSION', 2.05);
22
  define('SG_POPUP_PRO', 0);
23
  define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
24
 
29
  'video' => 'Video',
30
  'shortcode' => 'Shortcode',
31
  'ageRestriction' => 'Age Restriction',
32
+ 'countdown' => 'Countdown',
33
+ 'social' => 'Social'
34
  );
35
 
36
+ require_once( SG_APP_POPUP_CLASSES .'/SGPopup.php');
37
  require_once( SG_APP_POPUP_CLASSES .'/PopupInstaller.php'); //cretae tables
38
+ if (SG_POPUP_PRO) {
39
+ require_once( SG_APP_POPUP_CLASSES .'/PopupProInstaller.php'); //uninstall tables
40
+ }
41
  require_once( SG_APP_POPUP_PATH .'/style/sg_popup_style.php' ); //include our css file
42
  require_once( SG_APP_POPUP_JS .'/sg_popup_javascript.php' ); //include our js file
43
  require_once( SG_APP_POPUP_FILES .'/sg_popup_page_selection.php' ); // include here in page button for select popup every page
44
 
45
+ register_activation_hook(__FILE__, 'sgPopupActivate');
46
+ register_uninstall_hook(__FILE__, 'sgPopupDeactivate');
47
+ //register_deactivation_hook(__FILE__, 'sgPopupDeactivate');
48
 
49
 
50
+ add_action('wpmu_new_blog', 'sgNewBlogPopup', 10, 6);
51
 
52
+ function sgNewBlogPopup()
53
+ {
54
  PopupInstaller::install();
55
+ if (SG_POPUP_PRO) {
56
+ PopupProInstaller::install();
57
+ }
58
  }
59
+
60
+ function sgPopupActivate()
61
+ {
62
+ update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
63
  PopupInstaller::install();
64
+ if (SG_POPUP_PRO) {
65
+ PopupProInstaller::install();
66
+ }
67
  }
68
 
69
+ function sgPopupDeactivate()
70
+ {
71
+ delete_option('SG_POPUP_VERSION');
72
  PopupInstaller::uninstall();
73
+ if (SG_POPUP_PRO) {
74
+ PopupProInstaller::uninstall();
75
+ }
76
  }
77
 
78
 
79
  add_action("admin_menu","sgAddMenu");
80
+ function sgAddMenu()
81
+ {
82
  add_menu_page("Popup Builder", "Popup Builder", "manage_options","PopupBuilder","sgPopupMenu","dashicons-welcome-widgets-menus");
83
  add_submenu_page("PopupBuilder", "All Popups", "All Popups", 'manage_options', "PopupBuilder", "sgPopupMenu");
84
  add_submenu_page("PopupBuilder", "Add New", "Add New", 'manage_options', "create-popup", "sgCreatePopup");
85
+ add_submenu_page("PopupBuilder", "Edit Popup", "Edit Popup", 'manage_options', "edit-popup", "sgEditPopup");
86
  }
87
 
88
+ function sgPopupMenu()
89
+ {
90
  require_once( SG_APP_POPUP_FILES . '/sg_popup_main.php');
91
  }
92
 
93
+ function sgCreatePopup()
94
+ {
95
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_create.php'); // here is inculde file in the first sub menu
96
  }
97
 
98
+ function sgEditPopup()
99
+ {
100
  require_once( SG_APP_POPUP_FILES . '/sg_popup_create_new.php');
101
  }
102
 
103
+ function sgRegisterScripts()
104
+ {
105
  SGPopup::$registeredScripts = true;
106
+ wp_register_style('sg_animate', SG_APP_POPUP_URL . '/style/animate.css');
107
  wp_enqueue_style('sg_animate');
108
  wp_register_script('sg_popup_frontend', SG_APP_POPUP_URL . '/javascript/sg_popup_frontend.js', array('jquery'));
109
  wp_enqueue_script('sg_popup_frontend');
110
  wp_enqueue_script('jquery');
111
  wp_register_script('sg_cookie', SG_APP_POPUP_URL . '/javascript/jquery.cookie.js', array('jquery'));
112
  wp_enqueue_script('sg_cookie');
113
+ wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.colorbox-min.js', array('jquery'), '5.0');
114
  wp_enqueue_script('sg_colorbox');
115
+ if (SG_POPUP_PRO) {
116
+ wp_register_script('sgPopupPro', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js?ver=4.2.3');
117
+ wp_enqueue_script('sgPopupPro');
118
+ //echo "<script type='text/javascript' src = ".SG_APP_POPUP_URL."/javascript/sg_popup_pro.js?ver=4.2.3'></script>";
119
  }
120
  echo "<script type='text/javascript'>SG_POPUP_DATA = [];SG_APP_POPUP_URL = '".SG_APP_POPUP_URL."';</script>";
121
  }
122
 
123
+ function sgRenderPopupScript($id)
124
+ {
125
+ if (SGPopup::$registeredScripts==false) {
126
+ sgRegisterScripts();
127
+ }
128
  wp_register_style('sg_colorbox_theme', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox1.css");
129
  wp_register_style('sg_colorbox_theme2', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox2.css");
130
  wp_register_style('sg_colorbox_theme3', SG_APP_POPUP_URL . "/style/sgcolorbox/colorbox3.css");
138
  sgFindPopupData($id);
139
  }
140
 
141
+ function sgFindPopupData($id)
142
+ {
143
  $obj = SGPopup::findById($id);
144
+ if (!empty($obj)) {
145
+ $content = $obj->render();
146
+ }
147
  echo "<script type='text/javascript'>";
148
  echo $content;
149
  echo "</script>";
150
  }
151
 
152
+ function sgShowShortCode($args, $content)
153
+ {
154
  $obj = SGPopup::findById($args['id']);
155
+ if (!$obj) {
156
+ return $content;
157
+ }
158
+ if(!empty($content)) {
159
  sgRenderPopupScript($args['id']);
160
  return "<a href='javascript:void(0)' class='sg-show-popup' data-sgpopupid=".$args['id'].">".$content."</a>";
161
+ }
162
+ else {
163
+ sgRenderPopupOpen($args['id']);
164
+ }
165
  }
166
  add_shortCode('sg_popup', 'sgShowShortCode');
167
 
168
+ function sgAutoloadPopup($args) {
169
+ $popupId = SGPopup::findById($args['id']);
170
+ if(!$popupId) {
171
+ return;
172
+ }
173
+ sgRenderPopupOpen($args['id']);
174
+ }
175
+ add_shortCode('sg_autoload_popup', 'sgAutoloadPopup');
176
+
177
+ function sgRenderPopupOpen($popupId)
178
+ {
179
  sgRenderPopupScript($popupId);
180
  echo "<script>window.onload = function() {
181
  sgOnScrolling = (SG_POPUP_DATA [$popupId]['onScrolling']) ? SG_POPUP_DATA [$popupId]['onScrolling']: ''; ;
182
  beforeScrolingPrsent = (SG_POPUP_DATA [$popupId]['onScrolling']) ? SG_POPUP_DATA [$popupId]['beforeScrolingPrsent']: '';
183
  autoClosePopup = (SG_POPUP_DATA [$popupId]['autoClosePopup']) ? SG_POPUP_DATA [$popupId]['autoClosePopup']: '';
184
  popupClosingTimer = (SG_POPUP_DATA [$popupId]['popupClosingTimer']) ? SG_POPUP_DATA [$popupId]['popupClosingTimer']: '';
185
+ sgPoupFrontendObj = new SGPopup();
186
  if(sgOnScrolling) {
187
+ sgPoupFrontendObj.onScrolling($popupId);
188
+ }
189
  else {
190
+
191
+ sgPoupFrontendObj.showPopup($popupId,true);
192
  }
193
  }
194
  </script>";
195
+ }
196
 
197
+ function sgOnloadPopup()
198
+ {
199
+ $page = get_queried_object_id ();
200
+ $popup = "sg_promotional_popup";
201
+ $popupId = SGPopup::getPagePopupId($page,$popup);
202
+ if (!$popupId) {
203
+ return;
204
+ }
205
+ sgRenderPopupOpen($popupId);
206
  }
207
+
208
  add_action('wp_head','sgOnloadPopup');
209
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_media_button.php');
210
+ require_once( SG_APP_POPUP_FILES . '/sg_popup_save.php'); // saving form data
211
  require_once( SG_APP_POPUP_FILES . '/sg_popup_ajax.php');
212
 
213
+
214
+ function sgPopupPluginLoaded()
215
+ {
216
+ $versionPopup = get_option('SG_POPUP_VERSION');
217
+ if (!$versionPopup || $versionPopup < SG_POPUP_VERSION ) {
218
+ update_option('SG_POPUP_VERSION', SG_POPUP_VERSION);
219
+ }
220
  }
221
+
222
+ add_action('plugins_loaded', 'sgPopupPluginLoaded');
readme.txt CHANGED
@@ -52,6 +52,16 @@ With popup builder plugin you can insert any type of content, right into your Po
52
  Customizing the look and feel of the popup is as important as the content itself. That's why Popup Builder gives you the ability tu customize the timings, effects, position and size of the popup to your needs.
53
  </div>
54
 
 
 
 
 
 
 
 
 
 
 
55
  <div>
56
  <div>
57
  <br />
@@ -87,6 +97,16 @@ Go to the Popup Builder settings and set your desired options.
87
 
88
  == Changelog ==
89
 
 
 
 
 
 
 
 
 
 
 
90
  * Version 2.0.4
91
 
92
  Bug fixed with database collation.
52
  Customizing the look and feel of the popup is as important as the content itself. That's why Popup Builder gives you the ability tu customize the timings, effects, position and size of the popup to your needs.
53
  </div>
54
 
55
+
56
+ Popup Builder team constantly works on upgrades and improvements. With our upcoming updates we are planning to add more types of popups. Currently we are working on
57
+
58
+ > + Age Restriction popup - Sometimes the site content may not be appropriate for all audiences. In these cases, users may not be able to view the content until they pass age confirmation popup. Comming soon.
59
+ > + Social popup - This is a great type of a popup if you need to share/like your site. In social popup we have added all popular social networks like Facebook, Linkedin, Twitter, Google Plus etc. Comming soon.
60
+ > + Countdown popup - Your site is under construction and you are planing to open it in some amount of time, in this case countdown popup exactly for you.
61
+ > + Exit Intent popup - The general theory behind exit popups is fairly simple. Let’s imagine that a user has been browsing through your awesome site, then decides to leave without doing any of the things you want them to do (buying, registering etc). In that moment of indecision we can briefly interrupt them with a popup message, steering them towards a singular call to action.
62
+
63
+ Thank you for using our popup plugin.
64
+
65
  <div>
66
  <div>
67
  <br />
97
 
98
  == Changelog ==
99
 
100
+ * Version 2.0.5
101
+
102
+ Added shortcode to auto open popup.
103
+
104
+ Added new feature to support all screen positions where popup can be shown.
105
+
106
+ Code cleanup.
107
+
108
+ Bug fixed.
109
+
110
  * Version 2.0.4
111
 
112
  Bug fixed with database collation.
style/animate.css CHANGED
File without changes
style/sg_popup_rangeslider.css CHANGED
File without changes
style/sg_popup_style.css CHANGED
@@ -1,46 +1,76 @@
1
- /*new styles*/
2
  #wpwrap {
3
  overflow: hidden;
4
  margin-right: 1px;
5
  }
6
- #general .postbox-container,#effect .postbox-container, #dimentions .postbox-container,#options .postbox-container,#sepectialOptons .postbox-container,#proOptions .postbox-container{
 
 
 
 
 
 
7
  width: 100%;
8
  }
9
- .headersWrapper h2{
 
10
  padding-top: 0px;
11
  }
 
 
 
 
 
12
  h3.hndle .ui-sortable-handle .generalTitle {
13
  cursor: pointer;
14
- }
15
- .createPopupLink {
 
 
 
 
16
  cursor: pointer;
17
  }
 
18
  .hedlinePadding {
19
  padding: 18px 0px;
20
  }
21
- /*ned new styyle*/
22
 
23
- /******* coomon *******/
24
- .generalWrapper {
25
- margin-right: 2.5%;
26
  }
27
- .sameImageStyle {
 
 
28
  color: #3879D9;
29
  padding-top: 7px;
30
  }
 
31
  .improveOptionsstyle {
32
  margin-left: 0px;
33
  }
34
- .advancedOptionsContent .sameImageStyle {
35
- margin-left: 16px;
 
36
  }
 
37
  #displayNone {
38
  display: none;
39
  }
40
- #defaultMessage{
 
 
 
 
 
41
  margin-left: 0px;
42
- margin-right: 30px;
43
  }
 
 
 
 
 
 
44
  .samefontStyle {
45
  color: #3879D9;
46
  font: 14px Arial;
@@ -59,6 +89,7 @@ h3.hndle .ui-sortable-handle .generalTitle {
59
  z-index: 99999999999999999999999999;
60
  background-color: white;
61
  }
 
62
  .errorInfo {
63
  display: none;
64
  margin-left: 11px;
@@ -80,20 +111,24 @@ h3.hndle .ui-sortable-handle .generalTitle {
80
  z-index: 9999;
81
  background-color: white;
82
  }
83
- [class = sameWidthinputs ] {
 
84
  width: 44%;
85
- min-width: 165px;
86
  }
87
- .createDescribe{
 
88
  font: 13px "Open Sans", sans-serif;
89
  color: black;
90
  }
91
- .createDescribe + span{
 
92
  color: #3879D9;
93
  font: 14px Arial;
94
  padding-left: 12px;
95
  }
96
- .h2Background{
 
97
  background-color: #FAFAFA;
98
  display: inline-block;
99
  height: 50px;
@@ -101,35 +136,38 @@ h3.hndle .ui-sortable-handle .generalTitle {
101
  border-bottom: 1px solid #ccc;
102
  position: relative;
103
  }
104
- .h2Background h2{
 
105
  margin: 18px;
106
  display: inline-block;
107
  }
108
 
109
- .rightArrow{
110
- transform: rotate(0deg);
111
- }
112
- .turnArrow{
113
- transform: rotate(-180deg);
114
  }
115
-
116
- .dimensionsContent, .generalContent, .effectsContent, .optionsContent, .advancedOptionsContent {
117
- padding: 10px 20px;
118
  }
119
 
120
- #titlewrap {
 
 
 
 
 
121
  }
122
- .clear{
 
123
  clear: both;
124
  }
125
- /******* coomon end *******/
126
- /******* admin page ******/
127
 
128
- .headersWrapper {
129
  width: 100%;
130
  position: relative;
131
  }
132
- .mainUpdateToPro {
 
133
  position: absolute;
134
  right: 0px;
135
  top: 0px;
@@ -139,66 +177,56 @@ h3.hndle .ui-sortable-handle .generalTitle {
139
  color: white;
140
  cursor: pointer;
141
  }
142
- .crudToPro {
143
- float: right;
 
144
  margin-top: 7px;
145
  background-color: #D54E21;
146
  border: 1px solid #D54E21;
147
  color: white;
148
  cursor: pointer;
149
- margin-right: 2.5%;
150
  }
151
 
152
- .sgDeleteLink{
153
  margin-left: 10px;
154
  }
155
 
156
- #promotionalSaveButton{
157
  float: right;
158
- margin-right: 2.5%;
159
  }
 
160
  .improve-icon {
161
  padding-right: 2px;
162
  padding-top: 3px;
163
  }
164
- .creteLinkWrapper{
 
165
  display: inline-block;
166
  margin-bottom: 17px;
167
  margin-top: 10px;
168
  background-color: #E0E0E0;
169
  }
170
- .creteLinkWrapper a{
 
 
 
 
 
171
  display: block;
172
  padding: 6px;
173
  }
174
 
175
- #disine tr:nth-child(even){
176
  background-color: #F9F9F9;
177
  }
178
- #previewbuttonStyle {
179
- margin-right: 5px;
180
- background: #00a0d2;
181
- border-color: #0073aa;
182
- color: #fff;
183
- text-decoration: none;
184
- display: inline-block;
185
- font-size: 13px;
186
- line-height: 26px;
187
- height: 28px;
188
- margin: 0;
189
- padding: 0 10px 1px;
190
- cursor: pointer;
191
- border-width: 1px;
192
- border-style: solid;
193
- -webkit-appearance: none;
194
- border-radius: 3px;
195
- white-space: nowrap;
196
- }
197
- .previewParagaraph{
198
  display: inline-block;
199
  }
200
 
201
- span.phpErrorStyle{
202
  display: inline-block;
203
  margin-left: 5px;
204
  font: 18px Arial Sans-serif;
@@ -211,16 +239,16 @@ span.phpErrorStyle{
211
  border-left: 5px solid #7AD03A;
212
  background-color: #FFFFFF;
213
  }
 
214
  #gifLoader {
215
  margin-left: 5px;
216
  }
217
- .popupsWrapper {
 
218
  margin: 26px 0px 0px 0px;
219
  }
220
- /******* admin page end ******/
221
- /****** admin Create page ****/
222
 
223
- .popupsDiv {
224
  width: 200px;
225
  height: 150px;
226
  border: 1px solid #CCCCCC;
@@ -231,77 +259,89 @@ span.phpErrorStyle{
231
  background-size: 100%;
232
  transition: all .1s ease-in-out;
233
  }
234
- .popupsDiv:hover {
 
235
  background-color: #CDCDCD;
236
  transform: scale(1.05);
237
  }
238
- .htmlPopup {
239
- background-image: url(../img/HTML-Button.png);
 
240
  }
241
- .imagePopup {
242
- background-image: url(../img/Images-Button.png);
 
243
  }
244
- .iframePopup {
245
- background-image: url(../img/iframePopup.png);
 
246
  }
247
- .shortcodePopup {
248
- background-image: url(../img/ShortcodePopup.png);
 
249
  }
250
- .videoPopup {
251
- background-image: url(../img/VideoPopup.png);
 
252
  }
 
253
  .countdown {
254
- background-image: url(../img/Countdown.png);
255
  }
256
- .sgSocial {
257
- background-image: url(../img/SocialPopup.png);
 
258
  }
259
- .ageRestriction {
260
- background-image: url(../img/AgeRestriction.png);
 
261
  }
262
- .iframePopupPro {
263
- background-image: url(../img/iframePopupPro.png);
 
264
  }
265
- .shortcodePopupPro {
266
- background-image: url(../img/ShortcodePopupPro.png);
 
267
  }
268
- .videoPopupPro {
269
- background-image: url(../img/VideoPopupPro.png);
 
270
  }
271
- .ageRestrictionPro {
 
272
  background-color: blue;
273
  }
274
- /****** end create page *****/
275
- /******* general ******/
276
- #createAjaxLoader {
277
- float: right;
278
- margin-right: 11px;
279
- margin-top: 7px;
280
- }
281
  .generalMenu {
282
  width: 98%;
283
  height: 39px;
284
  }
285
- .contentType {
286
 
 
287
  margin: 10px auto;
288
  }
 
289
  .optionsH1 {
290
  font: 16px Arial,sans-serif;
291
  text-align: center;
292
  }
 
293
  .sgOptionsContent {
294
  width: 48%;
295
  margin: 0 auto;
296
  display: block;
297
  }
 
298
  .optinonsInput {
299
  width: 100%;
300
  }
301
- .htmlType {
 
302
  margin: 15px 0 0 0;
303
  }
304
- .contentTypeMain{
 
305
  border-right: 1px solid #ccc;
306
  border-bottom: 1px solid #ccc;
307
  border-left: 1px solid #ccc;
@@ -312,7 +352,7 @@ span.phpErrorStyle{
312
  margin-bottom: 26px;
313
  }
314
 
315
- .generalMenu > ul li {
316
  display: block;
317
  font: 14px Arial;
318
  color: black;
@@ -323,79 +363,85 @@ span.phpErrorStyle{
323
  text-align: center;
324
  border: 1px solid #ccc;
325
  cursor: pointer;
326
-
327
  }
328
- .imagetype{
 
329
  padding-bottom: 5px;
330
  min-height: 140px;
331
  }
332
- /*tab css*/
333
- .tabWrapper{
334
  background-color: #F1F1F1;
335
  margin-top: 12px;
336
  }
337
 
338
- /*----- Tabs -----*/
339
-
340
- /*----- Tab Links -----*/
341
- /* Clearfix */
342
-
343
-
344
-
345
-
346
- /*----- Content of Tabs -----*/
347
-
348
-
349
- input[id="upload_image_button"]{
350
- width: 37%;
351
  }
352
- #upload_image {
 
353
  width: 61%;
354
  }
355
- .imageUploderWrapper{
 
356
  margin: 0 auto;
357
  width: 82%;
358
  }
359
- .ShowSelectedImage {
 
360
  width: 222px;
361
  height: 127px;
362
  background-color: #F8F8F8;
363
  margin: 14px auto;
364
  background-size: contain;
365
- background-position: center center;
366
- background-repeat: no-repeat;
367
  }
368
- .NoImage {
 
369
  display: block;
370
  font: 13px Arial;
371
  margin: 0 auto;
372
  text-align: center;
373
  padding-top: 56px;
374
  }
375
- .imageHeadline{
 
376
  margin-top: 27px;
377
  margin-bottom: 41px;
378
  text-align: center;
379
  font: 16px arial;
380
  }
381
- .choosePopupType{
 
382
  margin-top: -3px;
383
  margin-left: 20px;
 
 
384
  }
 
385
  frametype h1 {
386
  text-align: center;
387
  padding-bottom: 34px;
388
  font: 16px arial;
389
  }
390
- .iframeContent{
 
391
  width: 48%;
392
  margin: 28px auto;
393
  }
394
- [name=iframeLink],[name=shortCode]{
 
 
395
  width: 100%;
396
- }
397
- /*its dive picturs*/
398
- .theme1,.theme2,.theme3,.theme4,.theme5{
 
 
 
 
399
  border: 0px solid red;
400
  width: 240px;
401
  height: 130px;
@@ -405,104 +451,127 @@ frametype h1 {
405
  position: absolute;
406
  z-index: 9999999999999999;
407
  }
408
- input[name="theme"]{
409
- margin-left: 14px;
410
 
 
 
411
  }
412
- .theme1{
413
- background-image: url(../img/theme1.jpg);
 
414
  background-size: 240px 130px;
415
  }
416
- .theme2{
417
- background-image: url(../img/theme2.jpg);
418
-
419
  }
420
- .theme3{
421
- background-image: url(../img/theme3.jpg);
 
422
  }
423
- .theme4{
424
- background-image: url(../img/theme4.jpg);
 
425
  background-size: 240px 130px;
426
  }
427
- .theme5{
428
- background-image: url(../img/theme5.jpg);
 
429
  background-size: 240px 130px;
430
  }
431
 
432
- /******* general end ******/
433
- /******* Effects ******/
 
 
 
 
 
 
 
 
 
434
  .effects {
435
  margin-top: 14px;
436
  background-color: white;
437
  margin-left: 3px;
438
  }
439
- .effects span img{
 
440
  margin-left: 3px;
441
  }
 
442
  .effectsContent {
443
  padding-left: 20px;
444
-
445
  }
446
- .effectsContent .sameWidthinputs{
447
- margin-right: 25px;
 
448
  }
 
449
  .theme input {
450
  margin-top: 13px;
451
  }
452
- #themeSPan{
 
453
  margin-top: 32px;
454
  }
455
- #themeSPan.createDescribe {
 
456
  margin-top: 10px;
457
- }
458
- /*effects*/
459
- .effects span{
460
  margin-top: 13px;
461
  }
462
- .effects select{
 
463
  margin-bottom: 10px;
464
  }
465
- .crudWrapper .createDescribe {
 
466
  display: inline-block;
467
  margin: 8px auto;
468
- width: 151px;
469
  }
470
- .crudWrapper .general .createDescribe {
 
471
  display: inline-block;
472
  margin: 8px auto;
473
  width: 62px;
474
  }
 
475
  .sameWidthinputsTitle {
476
  width: 60.0%;
477
  }
478
- #themeSPan {
 
479
  width: 138px;
480
  margin-top: 0px;
481
  }
482
 
483
-
484
- #sameWidthinputs{
485
  width: 44%;
486
  min-width: 165px;
487
  }
 
488
  #effectShow {
489
  display: none;
490
  width: 150px;
491
  height: 150px;
492
  margin-left: 5px;
493
- background-image: url(../img/theme4.jpg);
494
  background-size: 150px 150px;
495
  position: absolute;
496
  top: -46px;
497
  left: 72%;
498
  z-index: 9999;
499
  }
500
- .effectWrapper{
 
501
  position: relative;
502
-
503
  }
504
- /******* Effects end******/
505
- /******* dimensions ******/
506
 
507
  .dimensions {
508
  width: 100%;
@@ -510,271 +579,337 @@ input[name="theme"]{
510
  margin-right: 2.1%;
511
  box-sizing: border-box;
512
  }
513
- /******* dimensions end******/
514
-
515
- /******* options ******/
516
 
517
- .options{
518
- margin-top: 13px;
519
  }
520
- .optionsContent .createDescribe, .advancedOptionsContent .createDescribe,.specialOptionsContent .createDescribe,.effectsContent .createDescribe{
521
- width: 241px;
 
 
 
 
522
  }
523
- .optionsContent .sameWidthinputs {
524
- margin-right: 20px;
 
525
  }
526
- .optionsContent ,.advancedOptionsContent, .specialOptionsContent {
 
 
 
527
  background-color: white;
528
  position: relative;
529
  padding: 10px 20px 10px 20px;
530
  }
 
 
 
 
 
 
 
 
 
 
531
  .bootstrap-tagsinput .tag {
532
  background-color: #5BC0DE;
533
  padding: 0 3px 2px 3px;
534
  }
 
535
  .bootstrap-tagsinput > span {
536
  display: inline-block;
537
  }
 
538
  .optionsCountry {
539
  margin-left: -1px;
540
  }
541
- .autoClosePopupContent {
 
542
  width: 100%;
543
  display: none;
544
  }
 
545
  .popupTimer {
546
  width: 30px;
547
  }
 
548
  .optionStyle {
549
  font: 13px Arial, sans-serif;
550
  padding-left: 2px;
551
  display: inline-block;
552
  margin-bottom: 8px;
553
  }
554
- .range-bar {
555
- background-color: #a9acb1;
556
- border-radius: 15px;
557
- display: block;
558
- height: 4px;
559
- position: relative;
560
- width: 100%;
561
 
 
 
 
 
 
 
 
562
  }
563
 
564
  .range-quantity {
565
- background-color: #017afd;
566
- border-radius: 15px;
567
- display: block;
568
- height: 100%;
569
- width: 0;
570
  }
571
 
572
  .range-handle {
573
- background-color: #fff;
574
- border-radius: 100%;
575
- cursor: move;
576
- height: 20px;
577
- left: 0;
578
- top: -10px;
579
- position: absolute;
580
- width: 20px;
581
-
582
- -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
583
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
584
  }
585
 
586
  .range-min,
587
  .range-max {
588
-
589
- height: 20px;
590
- padding-top: 4px;
591
- position: absolute;
592
- text-align: center;
593
- top: -9px;
594
  display: none;
595
  }
596
- .slider-wrapper {
597
 
598
- position: relative;
599
- width: 150px;
600
- display: inline-block;
 
601
  }
602
 
603
  .vertical-wrapper {
604
- height: 200px;
605
- width: auto;
606
  }
 
607
  .display-box {
608
- background-color: #f7fcff;
609
- border-radius: 5px;
610
- font-size: 0.8em;
611
- height: 23px;
612
- right: -41px;
613
- box-sizing: border-box;
614
- padding-top: 6px;
615
- position: absolute;
616
- text-align: center;
617
- top: -10px;
618
- width: 35px;
619
-
620
- -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
621
- box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
622
- }
623
- #colorPiccer {
 
624
  display: inline-block;
625
  }
626
- #colorPiccer > .wp-picker-container .wp-color-result {
 
627
  top:12px;
628
  }
629
- .specialOptionsContent .wp-color-result:after{
630
- line-height: 24px;
 
 
 
 
631
  }
 
632
  .wp-picker-open+.wp-picker-input-wrap {
633
  float: right;
634
  margin-top: 12px;
635
  }
 
636
  .countrisConfigDiv {
637
  width: 100%;
638
  max-height: 150px;
639
  display: none;
640
  }
641
- .scrollingContent {
 
642
  width: 100%;
643
  display: none;
644
  }
645
- .beforeScrolingPrsent {
 
 
646
  width: 30px;
647
  }
648
- .scrollPresentSpan {
649
- padding-left: 4px;
 
650
  }
 
651
  .countrisConfigDivCountris {
652
  display: inline-block;
653
  width: 239px;
654
  }
 
655
  .autoCloseTimeContent {
656
  display: none;
657
  width: 100%;
658
  }
 
659
  .popupClosingTimer {
660
  width: 37px;
661
  }
662
- .fixedWrapper {
 
663
  max-width: 248px;
664
  width: 40%;
665
  height: 191px;
666
  display: inline-block;
 
667
  }
668
- .popopFixeds {
 
669
  width: 100%;
670
  display: none;
671
  }
672
- .forFixWrapperStyle {
673
- width: 241px;
 
674
  display: inline-block;
675
  }
676
- .fixedPositionStyle {
677
- width: 31.85%;
 
678
  height: 53px;
679
-
680
  float: left;
681
  cursor: pointer;
682
  }
683
- #fixedPosition2, #fixedPosition4 , #fixedPosition8,#fixedPosition6{
 
 
 
 
684
  float: left;
685
  width: 31.85%;
686
  height: 53px;
687
- background-color: rgb(241,241,241);
688
-
689
  }
690
- #fixedPosition1{
 
691
  border: 1px solid #ccc;
692
-
693
  }
694
 
695
- #fixedPosition2{
696
  border-bottom: 1px solid #ccc;
697
  border-top: 1px solid #ccc;
698
  }
699
- #fixedPosition3{
 
700
  border: 1px solid #ccc;
701
  }
702
- #fixedPosition6{
 
703
  border-left: 1px solid #ccc;
704
  border-right: 1px solid #ccc;
705
  }
706
- #fixedPosition9{
 
707
  border-left: 1px solid #ccc;
708
  border-bottom: 1px solid #ccc;
709
  border-right: 1px solid #ccc;
710
  border-top: 1px solid #ccc;
711
  }
712
- #fixedPosition8{
 
713
  border-left: 1px solid #ccc;
714
  border-bottom: 1px solid #ccc;
715
  border-top: 1px solid #ccc;
716
  }
717
- #fixedPosition7{
 
718
  border-top: 1px solid #ccc;
719
  border-left: 1px solid #ccc;
720
  border-bottom: 1px solid #ccc;
721
  }
722
 
723
- #fixedPosition4{
724
  border-right: 1px solid #ccc;
725
  border-left: 1px solid #ccc;
726
  }
727
- .specialSubDiv {
728
- margin-left: 40px;
 
 
729
  }
 
730
  .restrictionUrlDiv {
731
  display: none;
732
  width: 100%;
733
  }
734
 
735
- /******* options end ******/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
 
737
- /*style main*/
738
  .general {
739
  background-color: white;
740
  margin-left: 3px;
741
  margin-top: 5px;
742
  }
743
- .generalContent{
 
744
  padding-right: 20px;
745
  padding-left: 20px;
746
  }
747
- .Sg_title_crud{
 
748
  float: left;
749
  display: inline-block;
750
  }
751
- .cereateTitleWrapper{
 
752
  position: relative;
753
  }
754
- #leftMainDiv{
 
 
 
 
 
755
  width: 48.5%;
756
- float: left;
757
- margin-right: 1.5%;
758
- display: block;
759
  }
760
- #rightMaindiv{
 
761
  width: 50%;
762
- display: inline-block;
763
- float: right;
764
  }
765
- /
766
- /*meduia queris*/
767
 
768
  @media(max-width: 1042px) {
769
- #leftMainDiv #poststuff{
770
- width: 97.5%;
771
- margin: 0px auto;
772
- background-color: red;
773
- }
774
- #rightMaindiv #poststuff{
775
- width: 97.5%;
776
- margin: 0px auto;
777
- }
778
- }
779
- /*style css*/
780
-
 
1
  #wpwrap {
2
  overflow: hidden;
3
  margin-right: 1px;
4
  }
5
+
6
+ #sg-general .postbox-container,
7
+ #effect .postbox-container,
8
+ #dimentions .postbox-container,
9
+ #options .postbox-container,
10
+ #special-options .postbox-container,
11
+ #pro-options .postbox-container {
12
  width: 100%;
13
  }
14
+
15
+ .headersWrapper h2 {
16
  padding-top: 0px;
17
  }
18
+
19
+ #sg-insert-popup-id {
20
+ max-width: 250px;
21
+ }
22
+
23
  h3.hndle .ui-sortable-handle .generalTitle {
24
  cursor: pointer;
25
+ }
26
+
27
+ .title-max-width {
28
+ max-width: 200px;
29
+ }
30
+ .create-popup-link {
31
  cursor: pointer;
32
  }
33
+
34
  .hedlinePadding {
35
  padding: 18px 0px;
36
  }
 
37
 
38
+ .general-wrapper {
39
+ margin-right: 30px;
 
40
  }
41
+
42
+ .sameImageStyle,
43
+ .same-image-style {
44
  color: #3879D9;
45
  padding-top: 7px;
46
  }
47
+
48
  .improveOptionsstyle {
49
  margin-left: 0px;
50
  }
51
+
52
+ .advanced-options-content .same-image-style {
53
+ margin-left: 3%;
54
  }
55
+
56
  #displayNone {
57
  display: none;
58
  }
59
+
60
+ div.sg-hide {
61
+ display: none;
62
+ }
63
+
64
+ #default-message {
65
  margin-left: 0px;
66
+ margin-right: 36px;
67
  }
68
+
69
+ #title-error-message {
70
+ margin-left: 0px;
71
+ margin-right: 36px;
72
+ }
73
+
74
  .samefontStyle {
75
  color: #3879D9;
76
  font: 14px Arial;
89
  z-index: 99999999999999999999999999;
90
  background-color: white;
91
  }
92
+
93
  .errorInfo {
94
  display: none;
95
  margin-left: 11px;
111
  z-index: 9999;
112
  background-color: white;
113
  }
114
+
115
+ .input-width-static {
116
  width: 44%;
117
+ min-width: 165px;
118
  }
119
+
120
+ .liquid-width {
121
  font: 13px "Open Sans", sans-serif;
122
  color: black;
123
  }
124
+
125
+ .liquid-width + span {
126
  color: #3879D9;
127
  font: 14px Arial;
128
  padding-left: 12px;
129
  }
130
+
131
+ .h2Background {
132
  background-color: #FAFAFA;
133
  display: inline-block;
134
  height: 50px;
136
  border-bottom: 1px solid #ccc;
137
  position: relative;
138
  }
139
+
140
+ .h2Background h2 {
141
  margin: 18px;
142
  display: inline-block;
143
  }
144
 
145
+ .rightArrow {
146
+ transform: rotate(0deg);
 
 
 
147
  }
148
+
149
+ .turnArrow {
150
+ transform: rotate(-180deg);
151
  }
152
 
153
+ .dimensionsContent,
154
+ .generalContent,
155
+ .effectsContent,
156
+ .optionsContent,
157
+ .advanced-options-content {
158
+ padding: 10px 20px;
159
  }
160
+
161
+ .clear {
162
  clear: both;
163
  }
 
 
164
 
165
+ .headers-wrapper {
166
  width: 100%;
167
  position: relative;
168
  }
169
+
170
+ .main-update-to-pro {
171
  position: absolute;
172
  right: 0px;
173
  top: 0px;
177
  color: white;
178
  cursor: pointer;
179
  }
180
+
181
+ .crud-to-pro {
182
+ float: right;
183
  margin-top: 7px;
184
  background-color: #D54E21;
185
  border: 1px solid #D54E21;
186
  color: white;
187
  cursor: pointer;
188
+ margin-right: 30px;
189
  }
190
 
191
+ .sg-js-delete-link {
192
  margin-left: 10px;
193
  }
194
 
195
+ #sg-save-button {
196
  float: right;
197
+ margin-right: 30px;
198
  }
199
+
200
  .improve-icon {
201
  padding-right: 2px;
202
  padding-top: 3px;
203
  }
204
+
205
+ .creteLinkWrapper {
206
  display: inline-block;
207
  margin-bottom: 17px;
208
  margin-top: 10px;
209
  background-color: #E0E0E0;
210
  }
211
+
212
+ .tablenav-pages {
213
+ margin: 1em 0;
214
+ }
215
+
216
+ .creteLinkWrapper a {
217
  display: block;
218
  padding: 6px;
219
  }
220
 
221
+ #disine tr:nth-child(even) {
222
  background-color: #F9F9F9;
223
  }
224
+
225
+ .previewParagaraph {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  display: inline-block;
227
  }
228
 
229
+ span.phpErrorStyle {
230
  display: inline-block;
231
  margin-left: 5px;
232
  font: 18px Arial Sans-serif;
239
  border-left: 5px solid #7AD03A;
240
  background-color: #FFFFFF;
241
  }
242
+
243
  #gifLoader {
244
  margin-left: 5px;
245
  }
246
+
247
+ .popups-wrapper {
248
  margin: 26px 0px 0px 0px;
249
  }
 
 
250
 
251
+ .popups-div {
252
  width: 200px;
253
  height: 150px;
254
  border: 1px solid #CCCCCC;
259
  background-size: 100%;
260
  transition: all .1s ease-in-out;
261
  }
262
+
263
+ .popups-div:hover {
264
  background-color: #CDCDCD;
265
  transform: scale(1.05);
266
  }
267
+
268
+ .html-popup {
269
+ background-image: url("../img/HTML-Button.png");
270
  }
271
+
272
+ .image-popup {
273
+ background-image: url("../img/Images-Button.png");
274
  }
275
+
276
+ .iframe-popup {
277
+ background-image: url("../img/iframePopup.png");
278
  }
279
+
280
+ .shortcode-popup {
281
+ background-image: url("../img/ShortcodePopup.png");
282
  }
283
+
284
+ .video-popup {
285
+ background-image: url("../img/VideoPopup.png");
286
  }
287
+
288
  .countdown {
289
+ background-image: url("../img/Countdown.png");
290
  }
291
+
292
+ .sg-social {
293
+ background-image: url("../img/socialPopup.png");
294
  }
295
+
296
+ .age-restriction {
297
+ background-image: url("../img/AgeRestriction.png");
298
  }
299
+
300
+ .iframe-popup-pro {
301
+ background-image: url("../img/iframePopupPro.png");
302
  }
303
+
304
+ .shortcode-popup-pro {
305
+ background-image: url("../img/ShortcodePopupPro.png");
306
  }
307
+
308
+ .video-popup-pro {
309
+ background-image: url("../img/VideoPopupPro.png");
310
  }
311
+
312
+ .age-restriction-pro {
313
  background-color: blue;
314
  }
315
+
 
 
 
 
 
 
316
  .generalMenu {
317
  width: 98%;
318
  height: 39px;
319
  }
 
320
 
321
+ .contentType {
322
  margin: 10px auto;
323
  }
324
+
325
  .optionsH1 {
326
  font: 16px Arial,sans-serif;
327
  text-align: center;
328
  }
329
+
330
  .sgOptionsContent {
331
  width: 48%;
332
  margin: 0 auto;
333
  display: block;
334
  }
335
+
336
  .optinonsInput {
337
  width: 100%;
338
  }
339
+
340
+ .sg-wp-editor-container {
341
  margin: 15px 0 0 0;
342
  }
343
+
344
+ .contentTypeMain {
345
  border-right: 1px solid #ccc;
346
  border-bottom: 1px solid #ccc;
347
  border-left: 1px solid #ccc;
352
  margin-bottom: 26px;
353
  }
354
 
355
+ .generalMenu > ul li {
356
  display: block;
357
  font: 14px Arial;
358
  color: black;
363
  text-align: center;
364
  border: 1px solid #ccc;
365
  cursor: pointer;
366
+
367
  }
368
+
369
+ .imagetype {
370
  padding-bottom: 5px;
371
  min-height: 140px;
372
  }
373
+
374
+ .tabWrapper {
375
  background-color: #F1F1F1;
376
  margin-top: 12px;
377
  }
378
 
379
+ input[id="js-upload-image-button"] {
380
+ width: 37%;
 
 
 
 
 
 
 
 
 
 
 
381
  }
382
+
383
+ #js-upload-image {
384
  width: 61%;
385
  }
386
+
387
+ .image-uploader-wrapper {
388
  margin: 0 auto;
389
  width: 82%;
390
  }
391
+
392
+ .show-image-contenier {
393
  width: 222px;
394
  height: 127px;
395
  background-color: #F8F8F8;
396
  margin: 14px auto;
397
  background-size: contain;
398
+ background-position: center center;
399
+ background-repeat: no-repeat;
400
  }
401
+
402
+ .no-image {
403
  display: block;
404
  font: 13px Arial;
405
  margin: 0 auto;
406
  text-align: center;
407
  padding-top: 56px;
408
  }
409
+
410
+ .image-popup-headline {
411
  margin-top: 27px;
412
  margin-bottom: 41px;
413
  text-align: center;
414
  font: 16px arial;
415
  }
416
+
417
+ .choose-popup-type {
418
  margin-top: -3px;
419
  margin-left: 20px;
420
+ width: 20%;
421
+ max-width: 250px;
422
  }
423
+
424
  frametype h1 {
425
  text-align: center;
426
  padding-bottom: 34px;
427
  font: 16px arial;
428
  }
429
+
430
+ .iframeContent {
431
  width: 48%;
432
  margin: 28px auto;
433
  }
434
+
435
+ [name=iframeLink],
436
+ [name=shortCode] {
437
  width: 100%;
438
+ }
439
+
440
+ .theme1,
441
+ .theme2,
442
+ .theme3,
443
+ .theme4,
444
+ .theme5 {
445
  border: 0px solid red;
446
  width: 240px;
447
  height: 130px;
451
  position: absolute;
452
  z-index: 9999999999999999;
453
  }
 
 
454
 
455
+ input[name="theme"] {
456
+ margin-left: 14px;
457
  }
458
+
459
+ .theme1 {
460
+ background-image: url("../img/theme1.jpg");
461
  background-size: 240px 130px;
462
  }
463
+
464
+ .theme2 {
465
+ background-image: url("../img/theme2.jpg");
466
  }
467
+
468
+ .theme3 {
469
+ background-image: url("../img/theme3.jpg");
470
  }
471
+
472
+ .theme4 {
473
+ background-image: url("../img/theme4.jpg");
474
  background-size: 240px 130px;
475
  }
476
+
477
+ .theme5 {
478
+ background-image: url("../img/theme5.jpg");
479
  background-size: 240px 130px;
480
  }
481
 
482
+ .js-preview-effect {
483
+ background-image: url("../img/preview-eye.png");
484
+ width: 30px;
485
+ height: 30px;
486
+ position: relative;
487
+ top: 12px;
488
+ left: -10px;
489
+ display: inline-block;
490
+ cursor: pointer;
491
+ }
492
+
493
  .effects {
494
  margin-top: 14px;
495
  background-color: white;
496
  margin-left: 3px;
497
  }
498
+
499
+ .effects span img {
500
  margin-left: 3px;
501
  }
502
+
503
  .effectsContent {
504
  padding-left: 20px;
505
+
506
  }
507
+
508
+ .effectsContent .input-width-static {
509
+ margin-right: 5%;
510
  }
511
+
512
  .theme input {
513
  margin-top: 13px;
514
  }
515
+
516
+ #theme-span {
517
  margin-top: 32px;
518
  }
519
+
520
+ #theme-span.liquid-width {
521
  margin-top: 10px;
522
+ }
523
+
524
+ .effects span {
525
  margin-top: 13px;
526
  }
527
+
528
+ .effects select {
529
  margin-bottom: 10px;
530
  }
531
+
532
+ .crud-wrapper .liquid-width {
533
  display: inline-block;
534
  margin: 8px auto;
535
+ width: 151px;
536
  }
537
+
538
+ .crud-wrapper .general .liquid-width {
539
  display: inline-block;
540
  margin: 8px auto;
541
  width: 62px;
542
  }
543
+
544
  .sameWidthinputsTitle {
545
  width: 60.0%;
546
  }
547
+
548
+ #theme-span {
549
  width: 138px;
550
  margin-top: 0px;
551
  }
552
 
553
+ #sameWidthinputs {
 
554
  width: 44%;
555
  min-width: 165px;
556
  }
557
+
558
  #effectShow {
559
  display: none;
560
  width: 150px;
561
  height: 150px;
562
  margin-left: 5px;
563
+ background-image: url("../img/theme4.jpg");
564
  background-size: 150px 150px;
565
  position: absolute;
566
  top: -46px;
567
  left: 72%;
568
  z-index: 9999;
569
  }
570
+
571
+ .effectWrapper {
572
  position: relative;
573
+ display: inline-block;
574
  }
 
 
575
 
576
  .dimensions {
577
  width: 100%;
579
  margin-right: 2.1%;
580
  box-sizing: border-box;
581
  }
 
 
 
582
 
583
+ .options {
584
+ margin-top: 13px;
585
  }
586
+
587
+ .optionsContent .liquid-width,
588
+ .advanced-options-content .liquid-width,
589
+ .special-options-content .liquid-width,
590
+ .effectsContent .liquid-width {
591
+ width: 39%;
592
  }
593
+
594
+ .optionsContent .input-width-static {
595
+ margin-right: 3%;
596
  }
597
+
598
+ .optionsContent,
599
+ .advanced-options-content,
600
+ .special-options-content {
601
  background-color: white;
602
  position: relative;
603
  padding: 10px 20px 10px 20px;
604
  }
605
+
606
+ .js-spetial-postbox {
607
+ display: block;
608
+ }
609
+
610
+ .js-special-title,
611
+ .js-advanced-title {
612
+ cursor: pointer !important;
613
+ }
614
+
615
  .bootstrap-tagsinput .tag {
616
  background-color: #5BC0DE;
617
  padding: 0 3px 2px 3px;
618
  }
619
+
620
  .bootstrap-tagsinput > span {
621
  display: inline-block;
622
  }
623
+
624
  .optionsCountry {
625
  margin-left: -1px;
626
  }
627
+
628
+ .js-auto-close-content {
629
  width: 100%;
630
  display: none;
631
  }
632
+
633
  .popupTimer {
634
  width: 30px;
635
  }
636
+
637
  .optionStyle {
638
  font: 13px Arial, sans-serif;
639
  padding-left: 2px;
640
  display: inline-block;
641
  margin-bottom: 8px;
642
  }
 
 
 
 
 
 
 
643
 
644
+ .range-bar {
645
+ background-color: #a9acb1;
646
+ border-radius: 15px;
647
+ display: block;
648
+ height: 4px;
649
+ position: relative;
650
+ width: 100%;
651
  }
652
 
653
  .range-quantity {
654
+ background-color: #017afd;
655
+ border-radius: 15px;
656
+ display: block;
657
+ height: 100%;
658
+ width: 0;
659
  }
660
 
661
  .range-handle {
662
+ background-color: #fff;
663
+ border-radius: 100%;
664
+ cursor: move;
665
+ height: 20px;
666
+ left: 0;
667
+ top: -10px;
668
+ position: absolute;
669
+ width: 20px;
670
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
671
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
 
672
  }
673
 
674
  .range-min,
675
  .range-max {
676
+ height: 20px;
677
+ padding-top: 4px;
678
+ position: absolute;
679
+ text-align: center;
680
+ top: -9px;
 
681
  display: none;
682
  }
 
683
 
684
+ .slider-wrapper {
685
+ position: relative;
686
+ width: 150px;
687
+ display: inline-block;
688
  }
689
 
690
  .vertical-wrapper {
691
+ height: 200px;
692
+ width: auto;
693
  }
694
+
695
  .display-box {
696
+ background-color: #f7fcff;
697
+ border-radius: 5px;
698
+ font-size: 0.8em;
699
+ height: 23px;
700
+ right: -41px;
701
+ box-sizing: border-box;
702
+ padding-top: 6px;
703
+ position: absolute;
704
+ text-align: center;
705
+ top: -10px;
706
+ width: 35px;
707
+ -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
708
+ box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
709
+ }
710
+
711
+ #color-picker,
712
+ .color-picker {
713
  display: inline-block;
714
  }
715
+
716
+ #color-picker > .wp-picker-container .wp-color-result {
717
  top:12px;
718
  }
719
+
720
+ .color-picker > .wp-picker-container .wp-color-result {
721
+ top: 7px;
722
+ }
723
+ .special-options-content .wp-color-result:after {
724
+ line-height: 22px;
725
  }
726
+
727
  .wp-picker-open+.wp-picker-input-wrap {
728
  float: right;
729
  margin-top: 12px;
730
  }
731
+
732
  .countrisConfigDiv {
733
  width: 100%;
734
  max-height: 150px;
735
  display: none;
736
  }
737
+
738
+ .js-scrolling-content {
739
  width: 100%;
740
  display: none;
741
  }
742
+
743
+ .before-scroling-percent,
744
+ .input-width-percent {
745
  width: 30px;
746
  }
747
+
748
+ .span-percent {
749
+ margin-left: 4px;
750
  }
751
+
752
  .countrisConfigDivCountris {
753
  display: inline-block;
754
  width: 239px;
755
  }
756
+
757
  .autoCloseTimeContent {
758
  display: none;
759
  width: 100%;
760
  }
761
+
762
  .popupClosingTimer {
763
  width: 37px;
764
  }
765
+
766
+ .fixed-wrapper {
767
  max-width: 248px;
768
  width: 40%;
769
  height: 191px;
770
  display: inline-block;
771
+ margin-top: 4px;
772
  }
773
+
774
+ .js-popop-fixeds {
775
  width: 100%;
776
  display: none;
777
  }
778
+
779
+ .fix-wrapper-style {
780
+ width: 38.5%;
781
  display: inline-block;
782
  }
783
+
784
+ .js-fixed-position-style {
785
+ width: 31.85%;
786
  height: 53px;
 
787
  float: left;
788
  cursor: pointer;
789
  }
790
+
791
+ #fixed-position2,
792
+ #fixed-position4,
793
+ #fixed-position8,
794
+ #fixed-position6 {
795
  float: left;
796
  width: 31.85%;
797
  height: 53px;
 
 
798
  }
799
+
800
+ #fixed-position1 {
801
  border: 1px solid #ccc;
 
802
  }
803
 
804
+ #fixed-position2 {
805
  border-bottom: 1px solid #ccc;
806
  border-top: 1px solid #ccc;
807
  }
808
+
809
+ #fixed-position3 {
810
  border: 1px solid #ccc;
811
  }
812
+
813
+ #fixed-position6 {
814
  border-left: 1px solid #ccc;
815
  border-right: 1px solid #ccc;
816
  }
817
+
818
+ #fixed-position9 {
819
  border-left: 1px solid #ccc;
820
  border-bottom: 1px solid #ccc;
821
  border-right: 1px solid #ccc;
822
  border-top: 1px solid #ccc;
823
  }
824
+
825
+ #fixed-position8 {
826
  border-left: 1px solid #ccc;
827
  border-bottom: 1px solid #ccc;
828
  border-top: 1px solid #ccc;
829
  }
830
+
831
+ #fixed-position7 {
832
  border-top: 1px solid #ccc;
833
  border-left: 1px solid #ccc;
834
  border-bottom: 1px solid #ccc;
835
  }
836
 
837
+ #fixed-position4 {
838
  border-right: 1px solid #ccc;
839
  border-left: 1px solid #ccc;
840
  }
841
+
842
+ .socials-content {
843
+ display: block;
844
+ width: 100%;
845
  }
846
+
847
  .restrictionUrlDiv {
848
  display: none;
849
  width: 100%;
850
  }
851
 
852
+ .js-social-round-btn {
853
+ border-radius : 50% !important;
854
+ }
855
+
856
+ .radio-btn-fix {
857
+ margin-top: 0px !important;
858
+ margin-right: 5px !important;
859
+ }
860
+
861
+ #share-btns-container {
862
+ border: 1px solid #ccc;
863
+ margin: 10px 0px;
864
+ padding: 10px;
865
+ text-align: center;
866
+ }
867
 
 
868
  .general {
869
  background-color: white;
870
  margin-left: 3px;
871
  margin-top: 5px;
872
  }
873
+
874
+ .generalContent {
875
  padding-right: 20px;
876
  padding-left: 20px;
877
  }
878
+
879
+ .sg-title-crud {
880
  float: left;
881
  display: inline-block;
882
  }
883
+
884
+ .cereate-title-wrapper {
885
  position: relative;
886
  }
887
+
888
+ #title {
889
+ margin-top: 5px !important;
890
+ }
891
+
892
+ #left-main-div {
893
  width: 48.5%;
894
+ float: left;
895
+ margin-right: 1.5%;
896
+ display: block;
897
  }
898
+
899
+ #right-main-div {
900
  width: 50%;
901
+ display: inline-block;
902
+ float: right;
903
  }
 
 
904
 
905
  @media(max-width: 1042px) {
906
+ #left-main-div #poststuff {
907
+ width: 97.5%;
908
+ margin: 0px auto;
909
+ background-color: red;
910
+ }
911
+ #right-main-div #poststuff {
912
+ width: 97.5%;
913
+ margin: 0px auto;
914
+ }
915
+ }
 
 
style/sg_popup_style.php CHANGED
@@ -1,33 +1,32 @@
1
- <?php
2
- function sg_popup_admin_style($hook) {
3
- if ('toplevel_page_PopupBuilder' != $hook && 'popup-builder_page_create-popup' != $hook && 'popup-builder_page_edit-popup' != $hook && 'popup-builder_page_sgPopupMenu' != $hook) {
4
- return;
5
- }
6
- wp_register_style('sg_popup_style', SG_APP_POPUP_URL . '/style/sg_popup_style.css', false, '1.0.0');
7
- wp_enqueue_style('sg_popup_style');
8
- wp_register_style('sg_popup_animate', SG_APP_POPUP_URL . '/style/animate.css');
9
- wp_enqueue_style('sg_popup_animate');
10
-
11
- }
12
- add_action('admin_enqueue_scripts', 'sg_popup_admin_style');
13
-
14
- function sg_popup_style($hook) {
15
- if ('admin.php' != $hook && 'post.php' != $hook) {
16
- return;
17
- }
18
- wp_register_style('sg_popup_animate', SG_APP_POPUP_URL . '/style/animate.css');
19
- wp_enqueue_style('sg_popup_animate');
20
-
21
- wp_register_style('sg_popup_style', SG_APP_POPUP_URL . '/style/sg_popup_style.css', false, '1.0.0');
22
- wp_enqueue_style('sg_popup_style');
23
- }
24
-
25
- add_action('admin_enqueue_scripts', 'sg_popup_style');
26
- add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' );
27
- function mw_enqueue_color_picker( $hook_suffix ) {
28
- if('popup-builder_page_edit-popup' != $hook_suffix) {
29
- return;
30
- }
31
- wp_enqueue_style( 'wp-color-picker' );
32
- wp_enqueue_script( 'my-script-handle', plugins_url('javascript/sg_colorpicker.js',dirname(__FILE__)), array( 'wp-color-picker' ) );
33
- }
1
+ <?php
2
+ function sg_popup_admin_style($hook) {
3
+ if ('toplevel_page_PopupBuilder' != $hook && 'popup-builder_page_create-popup' != $hook && 'popup-builder_page_edit-popup' != $hook && 'popup-builder_page_sgPopupMenu' != $hook) {
4
+ return;
5
+ }
6
+ wp_register_style('sg_popup_style', SG_APP_POPUP_URL . '/style/sg_popup_style.css', false, '1.0.0');
7
+ wp_enqueue_style('sg_popup_style');
8
+ wp_register_style('sg_popup_animate', SG_APP_POPUP_URL . '/style/animate.css');
9
+ wp_enqueue_style('sg_popup_animate');
10
+ }
11
+ add_action('admin_enqueue_scripts', 'sg_popup_admin_style');
12
+
13
+ function sg_popup_style($hook) {
14
+ if ('admin.php' != $hook && 'post.php' != $hook) {
15
+ return;
16
+ }
17
+ wp_register_style('sg_popup_animate', SG_APP_POPUP_URL . '/style/animate.css');
18
+ wp_enqueue_style('sg_popup_animate');
19
+
20
+ wp_register_style('sg_popup_style', SG_APP_POPUP_URL . '/style/sg_popup_style.css', false, '1.0.0');
21
+ wp_enqueue_style('sg_popup_style');
22
+ }
23
+
24
+ add_action('admin_enqueue_scripts', 'sg_popup_style');
25
+ add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' );
26
+ function mw_enqueue_color_picker( $hook_suffix ) {
27
+ if('popup-builder_page_edit-popup' != $hook_suffix) {
28
+ return;
29
+ }
30
+ wp_enqueue_style( 'wp-color-picker' );
31
+ wp_enqueue_script( 'my-script-handle', plugins_url('javascript/sg_colorpicker.js',dirname(__FILE__)), array( 'wp-color-picker' ) );
32
+ }
 
style/sgcolorbox/colorbox1.css CHANGED
File without changes
style/sgcolorbox/colorbox2.css CHANGED
File without changes
style/sgcolorbox/colorbox3.css CHANGED
File without changes
style/sgcolorbox/colorbox4.css CHANGED
File without changes
style/sgcolorbox/colorbox5.css CHANGED
File without changes