| 1 |
<?php |
| 2 |
|
| 3 |
////////////////////////////////////////////////////////////// |
| 4 |
//=========================================================== |
| 5 |
// settings.php |
| 6 |
//=========================================================== |
| 7 |
// PAGELAYER |
| 8 |
// Inspired by the DESIRE to be the BEST OF ALL |
| 9 |
// ---------------------------------------------------------- |
| 10 |
// Started by: Pulkit Gupta |
| 11 |
// Date: 23rd Jan 2017 |
| 12 |
// Time: 23:00 hrs |
| 13 |
// Site: http://pagelayer.com/wordpress (PAGELAYER) |
| 14 |
// ---------------------------------------------------------- |
| 15 |
// Please Read the Terms of use at http://pagelayer.com/tos |
| 16 |
// ---------------------------------------------------------- |
| 17 |
//=========================================================== |
| 18 |
// (c)Pagelayer Team |
| 19 |
//=========================================================== |
| 20 |
////////////////////////////////////////////////////////////// |
| 21 |
|
| 22 |
// Are we being accessed directly ? |
| 23 |
if(!defined('PAGELAYER_VERSION')) { |
| 24 |
exit('Hacking Attempt !'); |
| 25 |
} |
| 26 |
|
| 27 |
$option_name = 'pl_gen_setting' ; |
| 28 |
$new_value = ''; |
| 29 |
|
| 30 |
if(isset($_REQUEST['pl_gen_setting'])){ |
| 31 |
$new_value = $_REQUEST['pl_gen_setting']; |
| 32 |
|
| 33 |
if ( get_option( $option_name ) !== false ) { |
| 34 |
|
| 35 |
// The option already exists, so we just update it. |
| 36 |
update_option( $option_name, $new_value ); |
| 37 |
|
| 38 |
} else { |
| 39 |
|
| 40 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 41 |
$deprecated = null; |
| 42 |
$autoload = 'no'; |
| 43 |
add_option( $option_name, $new_value, $deprecated, $autoload ); |
| 44 |
} |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
if(isset($_REQUEST['pl_support_ept'])){ |
| 49 |
|
| 50 |
$pl_support_ept = $_REQUEST['pl_support_ept']; |
| 51 |
|
| 52 |
if ( get_option( 'pl_support_ept' ) !== false ) { |
| 53 |
|
| 54 |
// The option already exists, so we just update it. |
| 55 |
update_option( 'pl_support_ept', $pl_support_ept ); |
| 56 |
|
| 57 |
} else { |
| 58 |
|
| 59 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 60 |
$deprecated = null; |
| 61 |
$autoload = 'no'; |
| 62 |
$pl_support_ept = ['post', 'page']; |
| 63 |
add_option( 'pl_support_ept', $pl_support_ept, $deprecated, $autoload ); |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
if(isset($_REQUEST['pagelayer_content_width'])){ |
| 68 |
|
| 69 |
$content_width = $_REQUEST['pagelayer_content_width']; |
| 70 |
|
| 71 |
if ( get_option( 'pagelayer_content_width' ) !== false ) { |
| 72 |
|
| 73 |
// The option already exists, so we just update it. |
| 74 |
update_option( 'pagelayer_content_width', $content_width ); |
| 75 |
|
| 76 |
} else { |
| 77 |
|
| 78 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 79 |
$deprecated = null; |
| 80 |
$autoload = 'no'; |
| 81 |
add_option( 'pagelayer_content_width', $content_width, $deprecated, $autoload ); |
| 82 |
} |
| 83 |
} |
| 84 |
|
| 85 |
if(isset($_REQUEST['pagelayer_between_widgets'])){ |
| 86 |
|
| 87 |
$space_widgets = $_REQUEST['pagelayer_between_widgets']; |
| 88 |
|
| 89 |
if ( get_option( 'pagelayer_between_widgets' ) !== false ) { |
| 90 |
|
| 91 |
// The option already exists, so we just update it. |
| 92 |
update_option( 'pagelayer_between_widgets', $space_widgets ); |
| 93 |
|
| 94 |
} else { |
| 95 |
|
| 96 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 97 |
$deprecated = null; |
| 98 |
$autoload = 'no'; |
| 99 |
add_option( 'pagelayer_between_widgets', $space_widgets, $deprecated, $autoload ); |
| 100 |
} |
| 101 |
} |
| 102 |
|
| 103 |
if(defined('PAGELAYER_PREMIUM')){ |
| 104 |
|
| 105 |
if(isset($_REQUEST['pagelayer_cf_to_email'])){ |
| 106 |
|
| 107 |
$to_email = $_REQUEST['pagelayer_cf_to_email']; |
| 108 |
|
| 109 |
if ( get_option( 'pagelayer_cf_to_email' ) !== false ) { |
| 110 |
|
| 111 |
// The option already exists, so we just update it. |
| 112 |
update_option( 'pagelayer_cf_to_email', $to_email ); |
| 113 |
|
| 114 |
} else { |
| 115 |
|
| 116 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 117 |
$deprecated = null; |
| 118 |
$autoload = 'no'; |
| 119 |
add_option( 'pagelayer_cf_to_email', $to_email, $deprecated, $autoload ); |
| 120 |
} |
| 121 |
} |
| 122 |
|
| 123 |
if(isset($_REQUEST['pagelayer_cf_subject'])){ |
| 124 |
|
| 125 |
$subject = $_REQUEST['pagelayer_cf_subject']; |
| 126 |
|
| 127 |
if ( get_option( 'pagelayer_cf_subject' ) !== false ) { |
| 128 |
|
| 129 |
// The option already exists, so we just update it. |
| 130 |
update_option( 'pagelayer_cf_subject', $subject ); |
| 131 |
|
| 132 |
} else { |
| 133 |
|
| 134 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 135 |
$deprecated = null; |
| 136 |
$autoload = 'no'; |
| 137 |
add_option( 'pagelayer_cf_subject', $subject, $deprecated, $autoload ); |
| 138 |
} |
| 139 |
} |
| 140 |
|
| 141 |
if(isset($_REQUEST['pagelayer_cf_success'])){ |
| 142 |
|
| 143 |
$success = $_REQUEST['pagelayer_cf_success']; |
| 144 |
|
| 145 |
if ( get_option( 'pagelayer_cf_success' ) !== false ) { |
| 146 |
|
| 147 |
// The option already exists, so we just update it. |
| 148 |
update_option( 'pagelayer_cf_success', $success ); |
| 149 |
|
| 150 |
} else { |
| 151 |
|
| 152 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 153 |
$deprecated = null; |
| 154 |
$autoload = 'no'; |
| 155 |
add_option( 'pagelayer_cf_success', $success, $deprecated, $autoload ); |
| 156 |
} |
| 157 |
} |
| 158 |
|
| 159 |
if(isset($_REQUEST['pagelayer_cf_failed'])){ |
| 160 |
|
| 161 |
$failed = $_REQUEST['pagelayer_cf_failed']; |
| 162 |
|
| 163 |
if ( get_option( 'pagelayer_cf_failed' ) !== false ) { |
| 164 |
|
| 165 |
// The option already exists, so we just update it. |
| 166 |
update_option( 'pagelayer_cf_failed', $failed ); |
| 167 |
|
| 168 |
} else { |
| 169 |
|
| 170 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 171 |
$deprecated = null; |
| 172 |
$autoload = 'no'; |
| 173 |
add_option( 'pagelayer_cf_failed', $failed, $deprecated, $autoload ); |
| 174 |
} |
| 175 |
} |
| 176 |
|
| 177 |
if(isset($_REQUEST['pagelayer_google_captcha'])){ |
| 178 |
|
| 179 |
$captcha = $_REQUEST['pagelayer_google_captcha']; |
| 180 |
|
| 181 |
if ( get_option( 'pagelayer_google_captcha' ) !== false ) { |
| 182 |
|
| 183 |
// The option already exists, so we just update it. |
| 184 |
update_option( 'pagelayer_google_captcha', $captcha ); |
| 185 |
|
| 186 |
} else { |
| 187 |
|
| 188 |
// The option hasn't been added yet. We'll add it with $autoload set to 'no'. |
| 189 |
$deprecated = null; |
| 190 |
$autoload = 'no'; |
| 191 |
add_option( 'pagelayer_google_captcha', $captcha, $deprecated, $autoload ); |
| 192 |
} |
| 193 |
} |
| 194 |
|
| 195 |
// Facebook APP ID |
| 196 |
if(isset($_REQUEST['pagelayer-fbapp-id'])){ |
| 197 |
$fb_app_id = $_REQUEST['pagelayer-fbapp-id']; |
| 198 |
|
| 199 |
// Save it |
| 200 |
update_option( 'pagelayer-fbapp-id', $fb_app_id ); |
| 201 |
} |
| 202 |
} |
| 203 |
|
| 204 |
$post_type = array('post', 'page', 'product'); |
| 205 |
|
| 206 |
$support_ept = get_option( 'pl_support_ept', ['post', 'page']); |
| 207 |
foreach ( $support_ept as $support_pl ) { |
| 208 |
add_post_type_support( $support_pl, 'pagelayer' ); |
| 209 |
} |
| 210 |
?> |
| 211 |
<form class="pagelayer-setting-form" method="post" action=""> |
| 212 |
<h1>PageLayer Editor</h1> |
| 213 |
<p>Welcome To PageLayer</p> |
| 214 |
<div class="tabs-wrapper"> |
| 215 |
<h2 class="nav-tab-wrapper pagelayer-wrapper"> |
| 216 |
<a href="#general" class="nav-tab">General</a> |
| 217 |
<a href="#settings" class="nav-tab ">Settings</a> |
| 218 |
<?php if(defined('PAGELAYER_PREMIUM')){ ?> |
| 219 |
<a href="#integration" class="nav-tab">Integrations</a> |
| 220 |
<a href="#contactform" class="nav-tab ">Contact Form</a> |
| 221 |
<a href="#captcha" class="nav-tab ">Google Captcha</a> |
| 222 |
<?php } ?> |
| 223 |
<a href="#support" class="nav-tab ">Support</a> |
| 224 |
<a href="#faq" class="nav-tab ">FAQ</a> |
| 225 |
</h2> |
| 226 |
|
| 227 |
<div class="pagelayer-tab-panel" id="general"> |
| 228 |
<table> |
| 229 |
<tr> |
| 230 |
<th scope="row">Editor Enables On </th> |
| 231 |
<td> |
| 232 |
<label> |
| 233 |
<?php |
| 234 |
foreach($post_type as $type){ |
| 235 |
|
| 236 |
echo '<input type="checkbox" name="pl_support_ept[]" value="'.$type.'" '. (in_array($type, $support_ept) ? "checked" : "") .'/>'.$type.'</br>'; |
| 237 |
} |
| 238 |
?> |
| 239 |
</label></td> |
| 240 |
</tr> |
| 241 |
</table> |
| 242 |
</div> |
| 243 |
<div class="pagelayer-tab-panel" id="settings"> |
| 244 |
<table> |
| 245 |
<tr> |
| 246 |
<th>Content Width</th> |
| 247 |
<td> |
| 248 |
<input name="pagelayer_content_width" type="number" step="1" min="320" max="5000" placeholder="1170" <?php if(get_option('pagelayer_content_width')){ |
| 249 |
echo 'value="'.get_option('pagelayer_content_width').'"'; |
| 250 |
}?>> |
| 251 |
<p>Set the custom width of the content area. The default width set is 1170px</p> |
| 252 |
</td> |
| 253 |
<tr> |
| 254 |
<tr> |
| 255 |
<th>Space Between Widgets</th> |
| 256 |
<td> |
| 257 |
<input name="pagelayer_between_widgets" type="number" step="1" min="0" max="500" placeholder="15" <?php if(get_option('pagelayer_between_widgets')){ |
| 258 |
echo 'value="'.get_option('pagelayer_between_widgets').'"'; |
| 259 |
}?>> |
| 260 |
<p>Set the Space Between Widgets. The default Space set is 15px</p> |
| 261 |
</td> |
| 262 |
<tr> |
| 263 |
</table> |
| 264 |
</div> |
| 265 |
<?php if(defined('PAGELAYER_PREMIUM')){ ?> |
| 266 |
<div class="pagelayer-tab-panel" id="integration"> |
| 267 |
<div class="pagelayer-title"> |
| 268 |
<h2>Facebook SDK Details</h2> |
| 269 |
</div> |
| 270 |
<table> |
| 271 |
<tr> |
| 272 |
<th>App ID</th> |
| 273 |
<td><input type="text" name="pagelayer-fbapp-id" class="pagelayer-app-id" <?php if(get_option('pagelayer-fbapp-id')){ |
| 274 |
echo 'value="'.get_option('pagelayer-fbapp-id').'"'; |
| 275 |
}?>/></td> |
| 276 |
</tr> |
| 277 |
</table> |
| 278 |
</div> |
| 279 |
<div class="pagelayer-tab-panel" id="contactform"> |
| 280 |
<table> |
| 281 |
<tr> |
| 282 |
<th scope="row">To Email: |
| 283 |
</th> |
| 284 |
<td> |
| 285 |
<label> |
| 286 |
<input name="pagelayer_cf_to_email" type="email" placeholder="email@domain.com" <?php if(get_option('pagelayer_cf_to_email')){ |
| 287 |
echo 'value="'.get_option('pagelayer_cf_to_email').'"'; |
| 288 |
}?>/> |
| 289 |
</label> |
| 290 |
</td> |
| 291 |
</tr> |
| 292 |
<tr> |
| 293 |
<th scope="row">Subject: |
| 294 |
</th> |
| 295 |
<td> |
| 296 |
<label> |
| 297 |
<input name="pagelayer_cf_subject" type="text" placeholder="Subject" <?php if(get_option('pagelayer_cf_subject')){ |
| 298 |
echo 'value="'.get_option('pagelayer_cf_subject').'"'; |
| 299 |
}?> /> |
| 300 |
</label> |
| 301 |
</td> |
| 302 |
</tr> |
| 303 |
<tr> |
| 304 |
<th scope="row">Success Message: |
| 305 |
</th> |
| 306 |
<td> |
| 307 |
<label> |
| 308 |
<input name="pagelayer_cf_success" type="text" placeholder="Success" <?php if(get_option('pagelayer_cf_success')){ |
| 309 |
echo 'value="'.get_option('pagelayer_cf_success').'"'; |
| 310 |
}?> /> |
| 311 |
</label> |
| 312 |
</td> |
| 313 |
</tr> |
| 314 |
<tr> |
| 315 |
<th scope="row">Failed Message: |
| 316 |
</th> |
| 317 |
<td> |
| 318 |
<label> |
| 319 |
<input name="pagelayer_cf_failed" type="text" placeholder="Failed" <?php if(get_option('pagelayer_cf_failed')){ |
| 320 |
echo 'value="'.get_option('pagelayer_cf_failed').'"'; |
| 321 |
}?> /> |
| 322 |
</label> |
| 323 |
</td> |
| 324 |
</tr> |
| 325 |
</table> |
| 326 |
</div> |
| 327 |
<div class="pagelayer-tab-panel" id="captcha"> |
| 328 |
<table> |
| 329 |
<tr> |
| 330 |
<th scope="row">Google ReCaptcha </th> |
| 331 |
</th> |
| 332 |
<td> |
| 333 |
<label> |
| 334 |
<input name="pagelayer_google_captcha" type="text" placeholder="captcha" <?php if(get_option('pagelayer_google_captcha')){ |
| 335 |
echo 'value="'.get_option('pagelayer_google_captcha').'"'; |
| 336 |
}?> /> |
| 337 |
</label> |
| 338 |
</td> |
| 339 |
</tr> |
| 340 |
</table> |
| 341 |
</div> |
| 342 |
<?php } ?> |
| 343 |
<div class="pagelayer-tab-panel" id="support"> |
| 344 |
<h2>Support</h2> |
| 345 |
<h3>You can contact the PageLayer Group via email. Our email address is <a href="mailto:support@pagelayer.com">support@pagelayer.com</a>. We will get back to you as soon as possible!</h3> |
| 346 |
|
| 347 |
|
| 348 |
</div> |
| 349 |
<div class="pagelayer-tab-panel" id="faq"> |
| 350 |
<h2>FAQ</h2> |
| 351 |
<div class="pagelayer-acc-wrapper"> |
| 352 |
<span class="nav-tab pagelayer-acc-tab">1: Why choose us</span> |
| 353 |
<div class="pagelayer-acc-panel"> |
| 354 |
<p>PageLayer is best live editor and easy to use and we will keep improving it !</P> |
| 355 |
</div> |
| 356 |
|
| 357 |
<span class="nav-tab pagelayer-acc-tab">2: Support</span> |
| 358 |
<div class="pagelayer-acc-panel"> |
| 359 |
<p>You can contact the PageLayer Group via email. Our email address is <a href="mailto:support@pagelayer.com">support@pagelayer.com</a>. We will get back to you as soon as possible!</p> |
| 360 |
</div> |
| 361 |
</div> |
| 362 |
</div> |
| 363 |
</div> |
| 364 |
<tr> |
| 365 |
<p> |
| 366 |
<input type="submit" name="submit" class="button button-primary" value="Save Changes"> |
| 367 |
</p> |
| 368 |
</form> |
| 369 |
|