PluginProbe
Page Builder: Pagelayer – Drag and Drop website builder / 1.0.4
Page Builder: Pagelayer – Drag and Drop website builder v1.0.4
2.2.1 2.2.0 2.1.9 2.1.8 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 trunk 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 1.0.0 1.0.2 1.0.3 1.0.4 1.0.5 All 129 releases
pagelayer / main / settings.php

settings.php in Page Builder: Pagelayer – Drag and Drop website builder 1.0.4, at main/settings.php

551 lines 17.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 // The Pagelayer Settings Header
28 function pagelayer_page_header($title = 'Pagelayer Editor'){
29
30 wp_enqueue_script( 'pagelayer-admin', PAGELAYER_JS.'/pagelayer-admin.js', array('jquery'), PAGELAYER_VERSION);
31 wp_enqueue_style( 'pagelayer-admin', PAGELAYER_CSS.'/pagelayer-admin.css', array(), PAGELAYER_VERSION);
32
33 echo '<div style="margin: 10px 20px 0 2px;">
34 <div class="metabox-holder columns-2">
35 <div class="postbox-container">
36 <div id="top-sortables" class="meta-box-sortables ui-sortable">
37
38 <table cellpadding="2" cellspacing="1" width="100%" class="fixed" border="0">
39 <tr>
40 <td valign="top"><h1>'.$title.'</h1></td>
41 <td align="right"><a target="_blank" class="button button-primary" href="https://wordpress.org/support/view/plugin-reviews/pagelayer">Review Pagelayer</a></td>
42 <td align="right" width="40"><a target="_blank" href="https://twitter.com/pagelayer"><img src="'.PAGELAYER_URL.'/images/twitter.png" /></a></td>
43 <td align="right" width="40"><a target="_blank" href="https://www.facebook.com/pagelayer/"><img src="'.PAGELAYER_URL.'/images/facebook.png" /></a></td>
44 </tr>
45 </table>
46 <hr />
47
48 <!--Main Table-->
49 <table cellpadding="8" cellspacing="1" width="100%" class="fixed">
50 <tr>
51 <td valign="top">';
52
53 }
54
55 // The Pagelayer Settings footer
56 function pagelayer_page_footer(){
57
58 echo '
59 </td>';
60
61 $promos = apply_filters('pagelayer_right_bar_promos', true);
62
63 if($promos){
64
65 echo '
66 <td width="200" valign="top" id="pagelayer-right-bar">';
67
68 if(!defined('PAGELAYER_PREMIUM')){
69
70 echo '
71 <div class="postbox" style="min-width:0px !important;">
72 <h2 class="hndle ui-sortable-handle">
73 <span><a target="_blank" href="'.PAGELAYER_PRO_URL.'"><img src="'.PAGELAYER_URL.'/images/pagelayer_product.png" width="100%" /></a></span>
74 </h2>
75 <div class="inside">
76 <i>Upgrade to the premium version and get the following features </i>:<br>
77 <ul class="pagelayer-right-ul">
78 <li>60+ Premium Widgets</li>
79 <li>400+ Premium Sections</li>
80 <li>Theme Builder</li>
81 <li>WooCommerce Builder</li>
82 <li>Theme Creator and Exporter</li>
83 <li>Form Builder</li>
84 <li>Popup Builder</li>
85 <li>And many more ...</li>
86 </ul>
87 <center><a class="button button-primary" target="_blank" href="'.PAGELAYER_PRO_URL.'">Upgrade</a></center>
88 </div>
89 </div>';
90
91 }
92
93 echo '
94 <div class="postbox" style="min-width:0px !important;">
95 <h2 class="hndle ui-sortable-handle">
96 <span><a target="_blank" href="https://wpcentral.co/?from=pagelayer-plugin"><img src="'.PAGELAYER_URL.'/images/wpcentral_product.png" width="100%" /></a></span>
97 </h2>
98 <div class="inside">
99 <i>Manage all your WordPress sites from <b>1 dashboard</b> </i>:<br>
100 <ul class="pagelayer-right-ul">
101 <li>1-click Admin Access</li>
102 <li>Update WordPress</li>
103 <li>Update Themes</li>
104 <li>Update Plugins</li>
105 <li>Backup your WordPress Site</li>
106 <li>Plugins & Theme Management</li>
107 <li>Post Management</li>
108 <li>And many more ...</li>
109 </ul>
110 <center><a class="button button-primary" target="_blank" href="https://wpcentral.co/?from=pagelayer-plugin">Visit wpCentral</a></center>
111 </div>
112 </div>
113
114 </td>';
115 }
116
117 echo '
118 </tr>
119 </table>
120 <br />
121 <div style="width:45%;background:#FFF;padding:15px; margin:auto">
122 <b>Let your followers know that you use Pagelayer to build your website :</b>
123 <form method="get" action="https://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
124 <textarea name="text" cols="45" row="3" style="resize:none;">I easily built my #WordPress #site using @pagelayer</textarea>
125 &nbsp; &nbsp; <input type="submit" value="Tweet!" class="button button-primary" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
126 </form>
127
128 </div>
129 <br />
130
131 <script>
132 function dotweet(ele){
133 window.open(jQuery("#"+ele.id).attr("action")+"?"+jQuery("#"+ele.id).serialize(), "_blank", "scrollbars=no, menubar=no, height=400, width=500, resizable=yes, toolbar=no, status=no");
134 return false;
135 }
136 </script>
137
138 <hr />
139 <a href="'.PAGELAYER_WWW_URL.'" target="_blank">Pagelayer</a> v'.PAGELAYER_VERSION.'. You can report any bugs <a href="http://wordpress.org/support/plugin/pagelayer" target="_blank">here</a>.
140
141 </div>
142 </div>
143 </div>
144 </div>';
145
146 }
147
148 function pagelayer_settings_page(){
149
150 $option_name = 'pl_gen_setting' ;
151 $new_value = '';
152
153 if(isset($_REQUEST['pl_gen_setting'])){
154 $new_value = $_REQUEST['pl_gen_setting'];
155
156 if ( get_option( $option_name ) !== false ) {
157
158 // The option already exists, so we just update it.
159 update_option( $option_name, $new_value );
160
161 } else {
162
163 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
164 $deprecated = null;
165 $autoload = 'no';
166 add_option( $option_name, $new_value, $deprecated, $autoload );
167 }
168
169 }
170
171 if(isset($_REQUEST['pl_support_ept'])){
172
173 $pl_support_ept = $_REQUEST['pl_support_ept'];
174
175 if ( get_option( 'pl_support_ept' ) !== false ) {
176
177 // The option already exists, so we just update it.
178 update_option( 'pl_support_ept', $pl_support_ept );
179
180 } else {
181
182 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
183 $deprecated = null;
184 $autoload = 'no';
185 $pl_support_ept = ['post', 'page'];
186 add_option( 'pl_support_ept', $pl_support_ept, $deprecated, $autoload );
187 }
188 }
189
190
191
192 if(isset($_REQUEST['pagelayer_icons_set'])){
193 $pagelayer_icons_set = $_REQUEST['pagelayer_icons_set'];
194
195 if ( get_option( 'pagelayer_icons_set' ) !== false ) {
196
197 // The option already exists, so we just update it.
198 update_option( 'pagelayer_icons_set', $pagelayer_icons_set);
199
200 } else {
201 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
202 $deprecated = null;
203 $autoload = 'no';
204 //$pagelayer_icons_set = [];
205 add_option( 'pagelayer_icons_set', $pagelayer_icons_set, $deprecated, $autoload );
206 }
207 }
208
209 if(isset($_REQUEST['pagelayer_content_width'])){
210
211 $content_width = $_REQUEST['pagelayer_content_width'];
212
213 if ( get_option( 'pagelayer_content_width' ) !== false ) {
214
215 // The option already exists, so we just update it.
216 update_option( 'pagelayer_content_width', $content_width );
217
218 } else {
219
220 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
221 $deprecated = null;
222 $autoload = 'no';
223 add_option( 'pagelayer_content_width', $content_width, $deprecated, $autoload );
224 }
225 }
226
227 if(isset($_REQUEST['pagelayer_between_widgets'])){
228
229 $space_widgets = $_REQUEST['pagelayer_between_widgets'];
230
231 if ( get_option( 'pagelayer_between_widgets' ) !== false ) {
232
233 // The option already exists, so we just update it.
234 update_option( 'pagelayer_between_widgets', $space_widgets );
235
236 } else {
237
238 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
239 $deprecated = null;
240 $autoload = 'no';
241 add_option( 'pagelayer_between_widgets', $space_widgets, $deprecated, $autoload );
242 }
243 }
244
245 if(isset($_REQUEST['pagelayer_body_font'])){
246
247 $body_font = $_REQUEST['pagelayer_body_font'];
248
249 if ( get_option( 'pagelayer_body_font' ) !== false ) {
250
251 // The option already exists, so we just update it.
252 update_option( 'pagelayer_body_font', $body_font );
253
254 } else {
255
256 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
257 $deprecated = null;
258 $autoload = 'no';
259 add_option( 'pagelayer_body_font', $body_font, $deprecated, $autoload );
260 }
261 }
262
263 if(defined('PAGELAYER_PREMIUM')){
264
265 if(isset($_REQUEST['pagelayer_cf_to_email'])){
266
267 $to_email = $_REQUEST['pagelayer_cf_to_email'];
268
269 if ( get_option( 'pagelayer_cf_to_email' ) !== false ) {
270
271 // The option already exists, so we just update it.
272 update_option( 'pagelayer_cf_to_email', $to_email );
273
274 } else {
275
276 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
277 $deprecated = null;
278 $autoload = 'no';
279 add_option( 'pagelayer_cf_to_email', $to_email, $deprecated, $autoload );
280 }
281 }
282
283 if(isset($_REQUEST['pagelayer_cf_subject'])){
284
285 $subject = $_REQUEST['pagelayer_cf_subject'];
286
287 if ( get_option( 'pagelayer_cf_subject' ) !== false ) {
288
289 // The option already exists, so we just update it.
290 update_option( 'pagelayer_cf_subject', $subject );
291
292 } else {
293
294 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
295 $deprecated = null;
296 $autoload = 'no';
297 add_option( 'pagelayer_cf_subject', $subject, $deprecated, $autoload );
298 }
299 }
300
301 if(isset($_REQUEST['pagelayer_cf_success'])){
302
303 $success = $_REQUEST['pagelayer_cf_success'];
304
305 if ( get_option( 'pagelayer_cf_success' ) !== false ) {
306
307 // The option already exists, so we just update it.
308 update_option( 'pagelayer_cf_success', $success );
309
310 } else {
311
312 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
313 $deprecated = null;
314 $autoload = 'no';
315 add_option( 'pagelayer_cf_success', $success, $deprecated, $autoload );
316 }
317 }
318
319 if(isset($_REQUEST['pagelayer_cf_failed'])){
320
321 $failed = $_REQUEST['pagelayer_cf_failed'];
322
323 if ( get_option( 'pagelayer_cf_failed' ) !== false ) {
324
325 // The option already exists, so we just update it.
326 update_option( 'pagelayer_cf_failed', $failed );
327
328 } else {
329
330 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
331 $deprecated = null;
332 $autoload = 'no';
333 add_option( 'pagelayer_cf_failed', $failed, $deprecated, $autoload );
334 }
335 }
336
337 if(isset($_REQUEST['pagelayer_google_captcha'])){
338
339 $captcha = $_REQUEST['pagelayer_google_captcha'];
340
341 if ( get_option( 'pagelayer_google_captcha' ) !== false ) {
342
343 // The option already exists, so we just update it.
344 update_option( 'pagelayer_google_captcha', $captcha );
345
346 } else {
347
348 // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
349 $deprecated = null;
350 $autoload = 'no';
351 add_option( 'pagelayer_google_captcha', $captcha, $deprecated, $autoload );
352 }
353 }
354
355 // Facebook APP ID
356 if(isset($_REQUEST['pagelayer-fbapp-id'])){
357 $fb_app_id = $_REQUEST['pagelayer-fbapp-id'];
358
359 // Save it
360 update_option( 'pagelayer-fbapp-id', $fb_app_id );
361 }
362 }
363
364 $post_type = array('post', 'page', 'product');
365
366 $support_ept = get_option( 'pl_support_ept', ['post', 'page']);
367 foreach ( $support_ept as $support_pl ) {
368 add_post_type_support( $support_pl, 'pagelayer' );
369 }
370
371 pagelayer_page_header('Pagelayer Settings');
372
373 ?>
374 <form class="pagelayer-setting-form" method="post" action="">
375 <div class="tabs-wrapper">
376 <h2 class="nav-tab-wrapper pagelayer-wrapper">
377 <a href="#general" class="nav-tab">General</a>
378 <a href="#settings" class="nav-tab ">Settings</a>
379 <a href="#icons" class="nav-tab ">Enable Icons</a>
380 <?php if(defined('PAGELAYER_PREMIUM')){ ?>
381 <a href="#integration" class="nav-tab">Integrations</a>
382 <a href="#contactform" class="nav-tab ">Contact Form</a>
383 <a href="#captcha" class="nav-tab ">Google Captcha</a>
384 <?php } ?>
385 <a href="#support" class="nav-tab ">Support</a>
386 <a href="#faq" class="nav-tab ">FAQ</a>
387 </h2>
388
389 <div class="pagelayer-tab-panel" id="general">
390 <table>
391 <tr>
392 <th scope="row">Editor Enables On </th>
393 <td>
394 <label>
395 <?php
396 foreach($post_type as $type){
397
398 echo '<input type="checkbox" name="pl_support_ept[]" value="'.$type.'" '. (in_array($type, $support_ept) ? "checked" : "") .'/>'.$type.'</br>';
399 }
400 ?>
401 </label>
402 </td>
403 </tr>
404 </table>
405 </div>
406 <div class="pagelayer-tab-panel" id="settings">
407 <table>
408 <tr>
409 <th>Content Width</th>
410 <td>
411 <input name="pagelayer_content_width" type="number" step="1" min="320" max="5000" placeholder="1170" <?php if(get_option('pagelayer_content_width')){
412 echo 'value="'.get_option('pagelayer_content_width').'"';
413 }?>>
414 <p>Set the custom width of the content area. The default width set is 1170px</p>
415 </td>
416 <tr>
417 <tr>
418 <th>Space Between Widgets</th>
419 <td>
420 <input name="pagelayer_between_widgets" type="number" step="1" min="0" max="500" placeholder="15" <?php if(get_option('pagelayer_between_widgets')){
421 echo 'value="'.get_option('pagelayer_between_widgets').'"';
422 }?>>
423 <p>Set the Space Between Widgets. The default Space set is 15px</p>
424 </td>
425 <tr>
426 <tr>
427 <th>Body Font</th>
428 <td>
429 <input name="pagelayer_body_font" type="text" placeholder="Open Sans" <?php if(get_option('pagelayer_body_font')){
430 echo 'value="'.get_option('pagelayer_body_font').'"';
431 }?>>
432 <p>Please give font name as it appears on Google fonts site. You can check all google fonts here: <a href="https://fonts.google.com" target="_blank">https://fonts.google.com</a></p>
433 </td>
434 <tr>
435 </table>
436 </div>
437 <div class="pagelayer-tab-panel" id="icons">
438 <table>
439 <tr>
440 <th scope="row">Enable Icons</th>
441 <td>
442 <label>
443 <input type="checkbox" name="pagelayer_icons_set[]" value="font-awesome5" <?php if(in_array('font-awesome5',get_option( 'pagelayer_icons_set')) || !get_option( 'pagelayer_icons_set')){echo ' checked';}?> />font-awesome5</br>
444 </label>
445 </td>
446 </tr>
447 </table>
448 </div>
449 <?php if(defined('PAGELAYER_PREMIUM')){ ?>
450 <div class="pagelayer-tab-panel" id="integration">
451 <div class="pagelayer-title">
452 <h2>Facebook SDK Details</h2>
453 </div>
454 <table>
455 <tr>
456 <th>App ID</th>
457 <td><input type="text" name="pagelayer-fbapp-id" class="pagelayer-app-id" <?php if(get_option('pagelayer-fbapp-id')){
458 echo 'value="'.get_option('pagelayer-fbapp-id').'"';
459 }?>/></td>
460 </tr>
461 </table>
462 </div>
463 <div class="pagelayer-tab-panel" id="contactform">
464 <table>
465 <tr>
466 <th scope="row">To Email:</th>
467 <td>
468 <label>
469 <input name="pagelayer_cf_to_email" type="email" placeholder="email@domain.com" <?php if(get_option('pagelayer_cf_to_email')){
470 echo 'value="'.get_option('pagelayer_cf_to_email').'"';
471 }?>/>
472 </label>
473 </td>
474 </tr>
475 <tr>
476 <th scope="row">Subject:</th>
477 <td>
478 <label>
479 <input name="pagelayer_cf_subject" type="text" placeholder="Subject" <?php if(get_option('pagelayer_cf_subject')){
480 echo 'value="'.get_option('pagelayer_cf_subject').'"';
481 }?> />
482 </label>
483 </td>
484 </tr>
485 <tr>
486 <th scope="row">Success Message:</th>
487 <td>
488 <label>
489 <input name="pagelayer_cf_success" type="text" placeholder="Success" <?php if(get_option('pagelayer_cf_success')){
490 echo 'value="'.get_option('pagelayer_cf_success').'"';
491 }?> />
492 </label>
493 </td>
494 </tr>
495 <tr>
496 <th scope="row">Failed Message: </th>
497 <td>
498 <label>
499 <input name="pagelayer_cf_failed" type="text" placeholder="Failed" <?php if(get_option('pagelayer_cf_failed')){
500 echo 'value="'.get_option('pagelayer_cf_failed').'"';
501 }?> />
502 </label>
503 </td>
504 </tr>
505 </table>
506 </div>
507 <div class="pagelayer-tab-panel" id="captcha">
508 <table>
509 <tr>
510 <th scope="row">Google ReCaptcha </th>
511 <td>
512 <label>
513 <input name="pagelayer_google_captcha" type="text" placeholder="captcha" <?php if(get_option('pagelayer_google_captcha')){
514 echo 'value="'.get_option('pagelayer_google_captcha').'"';
515 }?> />
516 </label>
517 </td>
518 </tr>
519 </table>
520 </div>
521 <?php } ?>
522 <div class="pagelayer-tab-panel" id="support">
523 <h2>Support</h2>
524 <h3>You can contact the Pagelayer Team 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>
525 </div>
526 <div class="pagelayer-tab-panel" id="faq">
527 <h2>FAQ</h2>
528 <div class="pagelayer-acc-wrapper">
529 <span class="nav-tab pagelayer-acc-tab">1: Why choose us</span>
530 <div class="pagelayer-acc-panel">
531 <p>Pagelayer is best live editor and easy to use and we will keep improving it !</P>
532 </div>
533
534 <span class="nav-tab pagelayer-acc-tab">2: Support</span>
535 <div class="pagelayer-acc-panel">
536 <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>
537 </div>
538 </div>
539 </div>
540 </div>
541 <p>
542 <input type="submit" name="submit" class="button button-primary" value="Save Changes">
543 </p>
544 </form>
545
546 <?php
547
548 pagelayer_page_footer();
549
550 }
551