Version Description
(December 05, 2020) = * [Improvement] Improved the export and import feature to use global font settings and exported menus and posts. * [Improvement] Added "Open link in new window (tab)" option to the image box button. * [Improvement] Added Hide Clip option in the animated heading widget to hide clip from the rotating heading with clip effects. * [Task] Pagelayer has been tested with WordPress 5.6 and we have made required changes. * [Task] In the some cases updating of a post / page was not working due to mod_security. To fix this, we are now base64 encoding strings and decoding the data in our AJAX calls. * [Task] Added an error alert when the pagelayer live editing would fail if the post was not found. This is a very rare bug, and we will try to add more such error alerts to make the issues clearly known to the user. * [Task] Added a check to verify the Facebook App ID format is correct when saving the same. * [Bug-Fix] The select and spinner type properties were overlapping in some cases when the label was long. We fixed this. * [Bug-Fix] The sub-menu of a primary menu widget contained unwanted padding. This is fixed. * [Bug-Fix] In some cases the height of the video widget container was rendered wrong. This is fixed. * [Bug-Fix] In some cases the set feature image option in pagelayer editor post properties was not working properly. This is fixed. * [Bug-Fix] While editing the accordion widget, the accordion active tab was shown and hidden multiple times. This is fixed. * [Bug-Fix] In the some cases the background video was not working properly. This is fixed. * [Bug-Fix] In the image slider widget the alt and title attributes were missing. This is fixed. * [Bug-Fix] In the Custom HTML widget the text field was not shown. This is fixed. * [Bug-Fix] The pagelayer-data key was not updated properly when saving the post. This caused the data of an existing post to be put within a row. This is fixed.
Release Info
Developer | pagelayer |
Plugin | Page Builder: PageLayer – Drag and Drop website builder |
Version | 1.3.6 |
Comparing to | |
See all releases |
Code changes from version 1.3.5 to 1.3.6
- css/combined.css +11 -1
- css/pagelayer-editor.css +6 -1
- css/pagelayer-frontend.css +11 -1
- init.php +55 -40
- js/base-64.js +371 -2
- js/base-64.min.js +11 -0
- js/combined.js +6 -4
- js/pagelayer-admin.js +4 -3
- js/pagelayer-editor.js +27 -25
- js/pagelayer-frontend.js +6 -4
- js/properties.js +24 -24
- js/widgets.js +5 -4
- languages/en.json +3 -1
- main/ajax.php +108 -5
- main/functions.php +283 -56
- main/getting_started.php +9 -9
- main/import.php +614 -99
- main/post_metas.php +73 -31
- main/settings.php +10 -4
- main/shortcode_functions.php +22 -18
- main/shortcodes.php +8 -0
- main/template.php +2 -1
- pagelayer.php +1 -1
- readme.txt +19 -1
@@ -1725,7 +1725,7 @@ padding:0;
|
|
1725 |
.pagelayer-video .pagelayer-video-holder{
|
1726 |
position:relative;
|
1727 |
width: 100%;
|
1728 |
-
height:
|
1729 |
overflow: hidden;
|
1730 |
}
|
1731 |
|
@@ -3048,6 +3048,7 @@ z-index:999;
|
|
3048 |
.pagelayer-wp-menu-container ul,
|
3049 |
.pagelayer-wp-menu-container ul.sub-menu{
|
3050 |
margin:0px;
|
|
|
3051 |
}
|
3052 |
|
3053 |
.pagelayer-menu-type-horizontal *{
|
@@ -4915,10 +4916,19 @@ display: inline-block;
|
|
4915 |
|
4916 |
/* Mega menu css start */
|
4917 |
|
|
|
|
|
|
|
|
|
4918 |
.pagelayer-mega-menu{
|
4919 |
width:800px;
|
4920 |
z-index:99999;
|
4921 |
text-align:center;
|
|
|
|
|
|
|
|
|
|
|
4922 |
}
|
4923 |
|
4924 |
.pagelayer-wp_menu .pagelayer-menu-type-vertical .pagelayer-mega-menu{
|
1725 |
.pagelayer-video .pagelayer-video-holder{
|
1726 |
position:relative;
|
1727 |
width: 100%;
|
1728 |
+
height: auto;
|
1729 |
overflow: hidden;
|
1730 |
}
|
1731 |
|
3048 |
.pagelayer-wp-menu-container ul,
|
3049 |
.pagelayer-wp-menu-container ul.sub-menu{
|
3050 |
margin:0px;
|
3051 |
+
padding: 0px;
|
3052 |
}
|
3053 |
|
3054 |
.pagelayer-menu-type-horizontal *{
|
4916 |
|
4917 |
/* Mega menu css start */
|
4918 |
|
4919 |
+
.pagelayer-mega-menu .pagelayer-content{
|
4920 |
+
width:100%;
|
4921 |
+
}
|
4922 |
+
|
4923 |
.pagelayer-mega-menu{
|
4924 |
width:800px;
|
4925 |
z-index:99999;
|
4926 |
text-align:center;
|
4927 |
+
padding:10px;
|
4928 |
+
}
|
4929 |
+
|
4930 |
+
.pagelayer-mega-menu .pagelayer-mega-menu-li{
|
4931 |
+
margin:10px;
|
4932 |
}
|
4933 |
|
4934 |
.pagelayer-wp_menu .pagelayer-menu-type-vertical .pagelayer-mega-menu{
|
@@ -661,6 +661,11 @@ padding:4px 0px 4px 0px;
|
|
661 |
position:relative;
|
662 |
}
|
663 |
|
|
|
|
|
|
|
|
|
|
|
664 |
.pagelayer-elp-label{
|
665 |
display: inline-block;
|
666 |
color: #555;
|
@@ -2001,7 +2006,7 @@ padding-left:5px;
|
|
2001 |
|
2002 |
.pagelayer-elp-select-div,
|
2003 |
.pagelayer-elp-spinner-div{
|
2004 |
-
width:
|
2005 |
right: 10px;
|
2006 |
position: absolute;
|
2007 |
top: 7px;
|
661 |
position:relative;
|
662 |
}
|
663 |
|
664 |
+
.pagelayer-elp-label-div[type=select],
|
665 |
+
.pagelayer-elp-label-div[type=spinner]{
|
666 |
+
width:50%;
|
667 |
+
}
|
668 |
+
|
669 |
.pagelayer-elp-label{
|
670 |
display: inline-block;
|
671 |
color: #555;
|
2006 |
|
2007 |
.pagelayer-elp-select-div,
|
2008 |
.pagelayer-elp-spinner-div{
|
2009 |
+
width: 50%;
|
2010 |
right: 10px;
|
2011 |
position: absolute;
|
2012 |
top: 7px;
|
@@ -1725,7 +1725,7 @@ padding:0;
|
|
1725 |
.pagelayer-video .pagelayer-video-holder{
|
1726 |
position:relative;
|
1727 |
width: 100%;
|
1728 |
-
height:
|
1729 |
overflow: hidden;
|
1730 |
}
|
1731 |
|
@@ -3048,6 +3048,7 @@ z-index:999;
|
|
3048 |
.pagelayer-wp-menu-container ul,
|
3049 |
.pagelayer-wp-menu-container ul.sub-menu{
|
3050 |
margin:0px;
|
|
|
3051 |
}
|
3052 |
|
3053 |
.pagelayer-menu-type-horizontal *{
|
@@ -4915,10 +4916,19 @@ display: inline-block;
|
|
4915 |
|
4916 |
/* Mega menu css start */
|
4917 |
|
|
|
|
|
|
|
|
|
4918 |
.pagelayer-mega-menu{
|
4919 |
width:800px;
|
4920 |
z-index:99999;
|
4921 |
text-align:center;
|
|
|
|
|
|
|
|
|
|
|
4922 |
}
|
4923 |
|
4924 |
.pagelayer-wp_menu .pagelayer-menu-type-vertical .pagelayer-mega-menu{
|
1725 |
.pagelayer-video .pagelayer-video-holder{
|
1726 |
position:relative;
|
1727 |
width: 100%;
|
1728 |
+
height: auto;
|
1729 |
overflow: hidden;
|
1730 |
}
|
1731 |
|
3048 |
.pagelayer-wp-menu-container ul,
|
3049 |
.pagelayer-wp-menu-container ul.sub-menu{
|
3050 |
margin:0px;
|
3051 |
+
padding: 0px;
|
3052 |
}
|
3053 |
|
3054 |
.pagelayer-menu-type-horizontal *{
|
4916 |
|
4917 |
/* Mega menu css start */
|
4918 |
|
4919 |
+
.pagelayer-mega-menu .pagelayer-content{
|
4920 |
+
width:100%;
|
4921 |
+
}
|
4922 |
+
|
4923 |
.pagelayer-mega-menu{
|
4924 |
width:800px;
|
4925 |
z-index:99999;
|
4926 |
text-align:center;
|
4927 |
+
padding:10px;
|
4928 |
+
}
|
4929 |
+
|
4930 |
+
.pagelayer-mega-menu .pagelayer-mega-menu-li{
|
4931 |
+
margin:10px;
|
4932 |
}
|
4933 |
|
4934 |
.pagelayer-wp_menu .pagelayer-menu-type-vertical .pagelayer-mega-menu{
|
@@ -5,7 +5,7 @@ if (!defined('ABSPATH')) exit;
|
|
5 |
|
6 |
define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
|
7 |
define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
|
8 |
-
define('PAGELAYER_VERSION', '1.3.
|
9 |
define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
|
10 |
define('PAGELAYER_SLUG', 'pagelayer');
|
11 |
define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
|
@@ -23,6 +23,10 @@ define('PAGELAYER_DEV', file_exists(dirname(__FILE__).'/dev.php') ? 1 : 0);
|
|
23 |
include_once(PAGELAYER_DIR.'/main/functions.php');
|
24 |
include_once(PAGELAYER_DIR.'/main/class.php');
|
25 |
|
|
|
|
|
|
|
|
|
26 |
// Ok so we are now ready to go
|
27 |
register_activation_hook(PAGELAYER_FILE, 'pagelayer_activation');
|
28 |
|
@@ -281,7 +285,7 @@ function pagelayer_meta_handler(){
|
|
281 |
}
|
282 |
|
283 |
// Pagelayer post meta page view handler
|
284 |
-
add_action('
|
285 |
function pagelayer_post_meta_page() {
|
286 |
|
287 |
// Set Current screen
|
@@ -303,6 +307,24 @@ function pagelayer_post_meta_page() {
|
|
303 |
$_REQUEST['post'] = (int) $_REQUEST['post'];
|
304 |
$post = get_post( $_REQUEST['post'] );
|
305 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
$meta_box_url = admin_url( 'post.php' );
|
307 |
$meta_box_url = add_query_arg(
|
308 |
array(
|
@@ -323,41 +345,6 @@ margin:auto;
|
|
323 |
|
324 |
<script type="text/javascript">
|
325 |
|
326 |
-
jQuery(document).ready(function(e){
|
327 |
-
pagelayer_prevent_click_metas();
|
328 |
-
});
|
329 |
-
|
330 |
-
// Prevent the click Inside the meta pages
|
331 |
-
function pagelayer_prevent_click_metas(){
|
332 |
-
jQuery(document).on("submit", function(event){
|
333 |
-
event.preventDefault();
|
334 |
-
});
|
335 |
-
|
336 |
-
jQuery(document).on("click", function(event){
|
337 |
-
var target = jQuery(event.target);
|
338 |
-
if (target.closest("a").length > 0) {
|
339 |
-
event.preventDefault();
|
340 |
-
var href = target.closest("a").attr("href");
|
341 |
-
|
342 |
-
if(!href.match(/(http|https):\/\//g)){
|
343 |
-
return;
|
344 |
-
}
|
345 |
-
|
346 |
-
var exp = new RegExp("(http|https):\/\/"+window.location.hostname, "g");
|
347 |
-
|
348 |
-
// Open new window
|
349 |
-
if(href.match(exp)){
|
350 |
-
|
351 |
-
// Reload same window
|
352 |
-
window.parent.location.assign(href);
|
353 |
-
}else{
|
354 |
-
window.open(href, "_blank");
|
355 |
-
}
|
356 |
-
|
357 |
-
}
|
358 |
-
});
|
359 |
-
}
|
360 |
-
|
361 |
function pagelayer_post_edit(jEle, e){
|
362 |
|
363 |
e.preventDefault();
|
@@ -760,13 +747,20 @@ function pagelayer_body_class($classes, $class){
|
|
760 |
|
761 |
// Load the live editor if needed
|
762 |
add_action('wp_enqueue_scripts', 'pagelayer_load_live', 9999);
|
763 |
-
|
764 |
function pagelayer_load_live(){
|
765 |
|
766 |
-
global $post;
|
|
|
|
|
767 |
|
768 |
// If its not live editing then stop
|
769 |
-
if(!pagelayer_is_live_iframe()){
|
|
|
|
|
|
|
|
|
|
|
|
|
770 |
return;
|
771 |
}
|
772 |
|
@@ -783,6 +777,22 @@ function pagelayer_load_live(){
|
|
783 |
|
784 |
}
|
785 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
786 |
// If we are doing ajax and its a pagelayer ajax
|
787 |
if(wp_doing_ajax()){
|
788 |
include_once(PAGELAYER_DIR.'/main/ajax.php');
|
@@ -878,6 +888,11 @@ add_filter( 'page_row_actions', 'pagelayer_quick_link', 10, 2 );
|
|
878 |
function pagelayer_quick_link($actions, $post){
|
879 |
global $pagelayer;
|
880 |
|
|
|
|
|
|
|
|
|
|
|
881 |
// Is pagelayer supposed to edit this ?
|
882 |
if(!pagelayer_user_can_edit($post)){
|
883 |
return $actions;
|
5 |
|
6 |
define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
|
7 |
define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
|
8 |
+
define('PAGELAYER_VERSION', '1.3.6');
|
9 |
define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
|
10 |
define('PAGELAYER_SLUG', 'pagelayer');
|
11 |
define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
|
23 |
include_once(PAGELAYER_DIR.'/main/functions.php');
|
24 |
include_once(PAGELAYER_DIR.'/main/class.php');
|
25 |
|
26 |
+
function pagelayer_died(){
|
27 |
+
print_r(error_get_last());
|
28 |
+
}
|
29 |
+
|
30 |
// Ok so we are now ready to go
|
31 |
register_activation_hook(PAGELAYER_FILE, 'pagelayer_activation');
|
32 |
|
285 |
}
|
286 |
|
287 |
// Pagelayer post meta page view handler
|
288 |
+
add_action('admin_enqueue_scripts', 'pagelayer_post_meta_page');
|
289 |
function pagelayer_post_meta_page() {
|
290 |
|
291 |
// Set Current screen
|
307 |
$_REQUEST['post'] = (int) $_REQUEST['post'];
|
308 |
$post = get_post( $_REQUEST['post'] );
|
309 |
|
310 |
+
// Enqueue Scripts
|
311 |
+
wp_enqueue_script( 'post' );
|
312 |
+
|
313 |
+
// Is support media
|
314 |
+
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' );
|
315 |
+
if ( ! $thumbnail_support && 'attachment' === $post->post_type && $post->post_mime_type ) {
|
316 |
+
if ( wp_attachment_is( 'audio', $post ) ) {
|
317 |
+
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
|
318 |
+
} elseif ( wp_attachment_is( 'video', $post ) ) {
|
319 |
+
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
if ( $thumbnail_support ) {
|
324 |
+
add_thickbox();
|
325 |
+
wp_enqueue_media( array( 'post' => $post->ID ) );
|
326 |
+
}
|
327 |
+
|
328 |
$meta_box_url = admin_url( 'post.php' );
|
329 |
$meta_box_url = add_query_arg(
|
330 |
array(
|
345 |
|
346 |
<script type="text/javascript">
|
347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
function pagelayer_post_edit(jEle, e){
|
349 |
|
350 |
e.preventDefault();
|
747 |
|
748 |
// Load the live editor if needed
|
749 |
add_action('wp_enqueue_scripts', 'pagelayer_load_live', 9999);
|
|
|
750 |
function pagelayer_load_live(){
|
751 |
|
752 |
+
global $post, $pagelayer;
|
753 |
+
|
754 |
+
$pagelayer->load_live_errors = array();
|
755 |
|
756 |
// If its not live editing then stop
|
757 |
+
if(!pagelayer_is_live_iframe($pagelayer->load_live_errors)){
|
758 |
+
|
759 |
+
// Is it the live mode then lets throw an error ?
|
760 |
+
if(pagelayer_optreq('pagelayer-iframe')){
|
761 |
+
add_action('wp_head', 'pagelayer_load_live_errors', 999);
|
762 |
+
}
|
763 |
+
|
764 |
return;
|
765 |
}
|
766 |
|
777 |
|
778 |
}
|
779 |
|
780 |
+
// Show the live errors if any
|
781 |
+
function pagelayer_load_live_errors(){
|
782 |
+
|
783 |
+
global $post, $pagelayer;
|
784 |
+
|
785 |
+
// Any errors ?
|
786 |
+
if(empty($pagelayer->load_live_errors)){
|
787 |
+
return;
|
788 |
+
}
|
789 |
+
|
790 |
+
echo '<script>
|
791 |
+
alert("'.str_replace('"', '\\"', implode("\n", $pagelayer->load_live_errors)).'");
|
792 |
+
</script>';
|
793 |
+
|
794 |
+
}
|
795 |
+
|
796 |
// If we are doing ajax and its a pagelayer ajax
|
797 |
if(wp_doing_ajax()){
|
798 |
include_once(PAGELAYER_DIR.'/main/ajax.php');
|
888 |
function pagelayer_quick_link($actions, $post){
|
889 |
global $pagelayer;
|
890 |
|
891 |
+
// Some woocommerce pages are not having ID
|
892 |
+
if(empty($post->ID)){
|
893 |
+
return $actions;
|
894 |
+
}
|
895 |
+
|
896 |
// Is pagelayer supposed to edit this ?
|
897 |
if(!pagelayer_user_can_edit($post)){
|
898 |
return $actions;
|
@@ -1,4 +1,373 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* [hi-base64]{@link https://github.com/emn178/hi-base64}
|
3 |
+
*
|
4 |
+
* @version 0.2.1
|
5 |
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
6 |
+
* @copyright Chen, Yi-Cyuan 2014-2017
|
7 |
+
* @license MIT
|
8 |
+
*/
|
9 |
+
/*jslint bitwise: true */
|
10 |
+
/*Modified by Pagelayer*/
|
11 |
+
(function () {
|
12 |
+
'use strict';
|
13 |
|
14 |
+
var root = typeof window === 'object' ? window : {};
|
15 |
+
var NODE_JS = false;
|
16 |
+
if (NODE_JS) {
|
17 |
+
root = global;
|
18 |
+
}
|
19 |
+
var COMMON_JS = !root.HI_BASE64_NO_COMMON_JS && typeof module === 'object' && module.exports;
|
20 |
+
var AMD = typeof define === 'function' && define.amd;
|
21 |
+
var BASE64_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
22 |
+
var BASE64_DECODE_CHAR = {
|
23 |
+
'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8,
|
24 |
+
'J': 9, 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16,
|
25 |
+
'R': 17, 'S': 18, 'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24,
|
26 |
+
'Z': 25, 'a': 26, 'b': 27, 'c': 28, 'd': 29, 'e': 30, 'f': 31, 'g': 32,
|
27 |
+
'h': 33, 'i': 34, 'j': 35, 'k': 36, 'l': 37, 'm': 38, 'n': 39, 'o': 40,
|
28 |
+
'p': 41, 'q': 42, 'r': 43, 's': 44, 't': 45, 'u': 46, 'v': 47, 'w': 48,
|
29 |
+
'x': 49, 'y': 50, 'z': 51, '0': 52, '1': 53, '2': 54, '3': 55, '4': 56,
|
30 |
+
'5': 57, '6': 58, '7': 59, '8': 60, '9': 61, '+': 62, '/': 63, '-': 62,
|
31 |
+
'_': 63
|
32 |
+
};
|
33 |
|
34 |
+
var utf8ToBytes = function (str) {
|
35 |
+
var bytes = [];
|
36 |
+
for (var i = 0; i < str.length; i++) {
|
37 |
+
var c = str.charCodeAt(i);
|
38 |
+
if (c < 0x80) {
|
39 |
+
bytes[bytes.length] = c;
|
40 |
+
} else if (c < 0x800) {
|
41 |
+
bytes[bytes.length] = 0xc0 | (c >> 6);
|
42 |
+
bytes[bytes.length] = 0x80 | (c & 0x3f);
|
43 |
+
} else if (c < 0xd800 || c >= 0xe000) {
|
44 |
+
bytes[bytes.length] = 0xe0 | (c >> 12);
|
45 |
+
bytes[bytes.length] = 0x80 | ((c >> 6) & 0x3f);
|
46 |
+
bytes[bytes.length] = 0x80 | (c & 0x3f);
|
47 |
+
} else {
|
48 |
+
c = 0x10000 + (((c & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));
|
49 |
+
bytes[bytes.length] = 0xf0 | (c >> 18);
|
50 |
+
bytes[bytes.length] = 0x80 | ((c >> 12) & 0x3f);
|
51 |
+
bytes[bytes.length] = 0x80 | ((c >> 6) & 0x3f);
|
52 |
+
bytes[bytes.length] = 0x80 | (c & 0x3f);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
return bytes;
|
56 |
+
};
|
57 |
+
|
58 |
+
var decodeAsBytes = function (base64Str) {
|
59 |
+
var v1, v2, v3, v4, bytes = [], index = 0, length = base64Str.length;
|
60 |
+
if (base64Str.charAt(length - 2) === '=') {
|
61 |
+
length -= 2;
|
62 |
+
} else if (base64Str.charAt(length - 1) === '=') {
|
63 |
+
length -= 1;
|
64 |
+
}
|
65 |
+
|
66 |
+
// 4 char to 3 bytes
|
67 |
+
for (var i = 0, count = length >> 2 << 2; i < count;) {
|
68 |
+
v1 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
69 |
+
v2 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
70 |
+
v3 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
71 |
+
v4 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
72 |
+
bytes[index++] = (v1 << 2 | v2 >>> 4) & 255;
|
73 |
+
bytes[index++] = (v2 << 4 | v3 >>> 2) & 255;
|
74 |
+
bytes[index++] = (v3 << 6 | v4) & 255;
|
75 |
+
}
|
76 |
+
|
77 |
+
// remain bytes
|
78 |
+
var remain = length - count;
|
79 |
+
if (remain === 2) {
|
80 |
+
v1 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
81 |
+
v2 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
82 |
+
bytes[index++] = (v1 << 2 | v2 >>> 4) & 255;
|
83 |
+
} else if (remain === 3) {
|
84 |
+
v1 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
85 |
+
v2 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
86 |
+
v3 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
87 |
+
bytes[index++] = (v1 << 2 | v2 >>> 4) & 255;
|
88 |
+
bytes[index++] = (v2 << 4 | v3 >>> 2) & 255;
|
89 |
+
}
|
90 |
+
return bytes;
|
91 |
+
};
|
92 |
+
|
93 |
+
var encodeFromBytes = function (bytes) {
|
94 |
+
var v1, v2, v3, base64Str = '', length = bytes.length;
|
95 |
+
for (var i = 0, count = parseInt(length / 3) * 3; i < count;) {
|
96 |
+
v1 = bytes[i++];
|
97 |
+
v2 = bytes[i++];
|
98 |
+
v3 = bytes[i++];
|
99 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
100 |
+
BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
|
101 |
+
BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
|
102 |
+
BASE64_ENCODE_CHAR[v3 & 63];
|
103 |
+
}
|
104 |
+
|
105 |
+
// remain char
|
106 |
+
var remain = length - count;
|
107 |
+
if (remain === 1) {
|
108 |
+
v1 = bytes[i];
|
109 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
110 |
+
BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
|
111 |
+
'==';
|
112 |
+
} else if (remain === 2) {
|
113 |
+
v1 = bytes[i++];
|
114 |
+
v2 = bytes[i];
|
115 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
116 |
+
BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
|
117 |
+
BASE64_ENCODE_CHAR[(v2 << 2) & 63] +
|
118 |
+
'=';
|
119 |
+
}
|
120 |
+
return base64Str;
|
121 |
+
};
|
122 |
+
|
123 |
+
var btoa = root.btoa, atob = root.atob, utf8Base64Encode, utf8Base64Decode;
|
124 |
+
if (NODE_JS) {
|
125 |
+
} else if (!btoa) {
|
126 |
+
btoa = function (str) {
|
127 |
+
var v1, v2, v3, base64Str = '', length = str.length;
|
128 |
+
for (var i = 0, count = parseInt(length / 3) * 3; i < count;) {
|
129 |
+
v1 = str.charCodeAt(i++);
|
130 |
+
v2 = str.charCodeAt(i++);
|
131 |
+
v3 = str.charCodeAt(i++);
|
132 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
133 |
+
BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
|
134 |
+
BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
|
135 |
+
BASE64_ENCODE_CHAR[v3 & 63];
|
136 |
+
}
|
137 |
+
|
138 |
+
// remain char
|
139 |
+
var remain = length - count;
|
140 |
+
if (remain === 1) {
|
141 |
+
v1 = str.charCodeAt(i);
|
142 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
143 |
+
BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
|
144 |
+
'==';
|
145 |
+
} else if (remain === 2) {
|
146 |
+
v1 = str.charCodeAt(i++);
|
147 |
+
v2 = str.charCodeAt(i);
|
148 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
149 |
+
BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
|
150 |
+
BASE64_ENCODE_CHAR[(v2 << 2) & 63] +
|
151 |
+
'=';
|
152 |
+
}
|
153 |
+
return base64Str;
|
154 |
+
};
|
155 |
+
|
156 |
+
utf8Base64Encode = function (str) {
|
157 |
+
var v1, v2, v3, base64Str = '', bytes = utf8ToBytes(str), length = bytes.length;
|
158 |
+
for (var i = 0, count = parseInt(length / 3) * 3; i < count;) {
|
159 |
+
v1 = bytes[i++];
|
160 |
+
v2 = bytes[i++];
|
161 |
+
v3 = bytes[i++];
|
162 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
163 |
+
BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
|
164 |
+
BASE64_ENCODE_CHAR[(v2 << 2 | v3 >>> 6) & 63] +
|
165 |
+
BASE64_ENCODE_CHAR[v3 & 63];
|
166 |
+
}
|
167 |
+
|
168 |
+
// remain char
|
169 |
+
var remain = length - count;
|
170 |
+
if (remain === 1) {
|
171 |
+
v1 = bytes[i];
|
172 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
173 |
+
BASE64_ENCODE_CHAR[(v1 << 4) & 63] +
|
174 |
+
'==';
|
175 |
+
} else if (remain === 2) {
|
176 |
+
v1 = bytes[i++];
|
177 |
+
v2 = bytes[i];
|
178 |
+
base64Str += BASE64_ENCODE_CHAR[v1 >>> 2] +
|
179 |
+
BASE64_ENCODE_CHAR[(v1 << 4 | v2 >>> 4) & 63] +
|
180 |
+
BASE64_ENCODE_CHAR[(v2 << 2) & 63] +
|
181 |
+
'=';
|
182 |
+
}
|
183 |
+
return base64Str;
|
184 |
+
};
|
185 |
+
|
186 |
+
atob = function (base64Str) {
|
187 |
+
var v1, v2, v3, v4, str = '', length = base64Str.length;
|
188 |
+
if (base64Str.charAt(length - 2) === '=') {
|
189 |
+
length -= 2;
|
190 |
+
} else if (base64Str.charAt(length - 1) === '=') {
|
191 |
+
length -= 1;
|
192 |
+
}
|
193 |
+
|
194 |
+
// 4 char to 3 bytes
|
195 |
+
for (var i = 0, count = length >> 2 << 2; i < count;) {
|
196 |
+
v1 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
197 |
+
v2 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
198 |
+
v3 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
199 |
+
v4 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
200 |
+
str += String.fromCharCode((v1 << 2 | v2 >>> 4) & 255) +
|
201 |
+
String.fromCharCode((v2 << 4 | v3 >>> 2) & 255) +
|
202 |
+
String.fromCharCode((v3 << 6 | v4) & 255);
|
203 |
+
}
|
204 |
+
|
205 |
+
// remain bytes
|
206 |
+
var remain = length - count;
|
207 |
+
if (remain === 2) {
|
208 |
+
v1 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
209 |
+
v2 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
210 |
+
str += String.fromCharCode((v1 << 2 | v2 >>> 4) & 255);
|
211 |
+
} else if (remain === 3) {
|
212 |
+
v1 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
213 |
+
v2 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
214 |
+
v3 = BASE64_DECODE_CHAR[base64Str.charAt(i++)];
|
215 |
+
str += String.fromCharCode((v1 << 2 | v2 >>> 4) & 255) +
|
216 |
+
String.fromCharCode((v2 << 4 | v3 >>> 2) & 255);
|
217 |
+
}
|
218 |
+
return str;
|
219 |
+
};
|
220 |
+
|
221 |
+
utf8Base64Decode = function (base64Str) {
|
222 |
+
var str = '', bytes = decodeAsBytes(base64Str), length = bytes.length;
|
223 |
+
var i = 0, followingChars = 0, b, c;
|
224 |
+
while (i < length) {
|
225 |
+
b = bytes[i++];
|
226 |
+
if (b <= 0x7F) {
|
227 |
+
str += String.fromCharCode(b);
|
228 |
+
continue;
|
229 |
+
} else if (b > 0xBF && b <= 0xDF) {
|
230 |
+
c = b & 0x1F;
|
231 |
+
followingChars = 1;
|
232 |
+
} else if (b <= 0xEF) {
|
233 |
+
c = b & 0x0F;
|
234 |
+
followingChars = 2;
|
235 |
+
} else if (b <= 0xF7) {
|
236 |
+
c = b & 0x07;
|
237 |
+
followingChars = 3;
|
238 |
+
} else {
|
239 |
+
throw 'not a UTF-8 string';
|
240 |
+
}
|
241 |
+
|
242 |
+
for (var j = 0; j < followingChars; ++j) {
|
243 |
+
b = bytes[i++];
|
244 |
+
if (b < 0x80 || b > 0xBF) {
|
245 |
+
throw 'not a UTF-8 string';
|
246 |
+
}
|
247 |
+
c <<= 6;
|
248 |
+
c += b & 0x3F;
|
249 |
+
}
|
250 |
+
if (c >= 0xD800 && c <= 0xDFFF) {
|
251 |
+
throw 'not a UTF-8 string';
|
252 |
+
}
|
253 |
+
if (c > 0x10FFFF) {
|
254 |
+
throw 'not a UTF-8 string';
|
255 |
+
}
|
256 |
+
|
257 |
+
if (c <= 0xFFFF) {
|
258 |
+
str += String.fromCharCode(c);
|
259 |
+
} else {
|
260 |
+
c -= 0x10000;
|
261 |
+
str += String.fromCharCode((c >> 10) + 0xD800);
|
262 |
+
str += String.fromCharCode((c & 0x3FF) + 0xDC00);
|
263 |
+
}
|
264 |
+
}
|
265 |
+
return str;
|
266 |
+
};
|
267 |
+
} else {
|
268 |
+
utf8Base64Encode = function (str) {
|
269 |
+
var result = '';
|
270 |
+
for (var i = 0; i < str.length; i++) {
|
271 |
+
var charcode = str.charCodeAt(i);
|
272 |
+
if (charcode < 0x80) {
|
273 |
+
result += String.fromCharCode(charcode);
|
274 |
+
} else if (charcode < 0x800) {
|
275 |
+
result += String.fromCharCode(0xc0 | (charcode >> 6)) +
|
276 |
+
String.fromCharCode(0x80 | (charcode & 0x3f));
|
277 |
+
} else if (charcode < 0xd800 || charcode >= 0xe000) {
|
278 |
+
result += String.fromCharCode(0xe0 | (charcode >> 12)) +
|
279 |
+
String.fromCharCode(0x80 | ((charcode >> 6) & 0x3f)) +
|
280 |
+
String.fromCharCode(0x80 | (charcode & 0x3f));
|
281 |
+
} else {
|
282 |
+
charcode = 0x10000 + (((charcode & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));
|
283 |
+
result += String.fromCharCode(0xf0 | (charcode >> 18)) +
|
284 |
+
String.fromCharCode(0x80 | ((charcode >> 12) & 0x3f)) +
|
285 |
+
String.fromCharCode(0x80 | ((charcode >> 6) & 0x3f)) +
|
286 |
+
String.fromCharCode(0x80 | (charcode & 0x3f));
|
287 |
+
}
|
288 |
+
}
|
289 |
+
return btoa(result);
|
290 |
+
};
|
291 |
+
|
292 |
+
utf8Base64Decode = function (base64Str) {
|
293 |
+
var tmpStr = atob(base64Str.trim('=').replace(/-/g, '+').replace(/_/g, '/'));
|
294 |
+
if (!/[^\x00-\x7F]/.test(tmpStr)) {
|
295 |
+
return tmpStr;
|
296 |
+
}
|
297 |
+
var str = '', i = 0, length = tmpStr.length, followingChars = 0, b, c;
|
298 |
+
while (i < length) {
|
299 |
+
b = tmpStr.charCodeAt(i++);
|
300 |
+
if (b <= 0x7F) {
|
301 |
+
str += String.fromCharCode(b);
|
302 |
+
continue;
|
303 |
+
} else if (b > 0xBF && b <= 0xDF) {
|
304 |
+
c = b & 0x1F;
|
305 |
+
followingChars = 1;
|
306 |
+
} else if (b <= 0xEF) {
|
307 |
+
c = b & 0x0F;
|
308 |
+
followingChars = 2;
|
309 |
+
} else if (b <= 0xF7) {
|
310 |
+
c = b & 0x07;
|
311 |
+
followingChars = 3;
|
312 |
+
} else {
|
313 |
+
throw 'not a UTF-8 string';
|
314 |
+
}
|
315 |
+
|
316 |
+
for (var j = 0; j < followingChars; ++j) {
|
317 |
+
b = tmpStr.charCodeAt(i++);
|
318 |
+
if (b < 0x80 || b > 0xBF) {
|
319 |
+
throw 'not a UTF-8 string';
|
320 |
+
}
|
321 |
+
c <<= 6;
|
322 |
+
c += b & 0x3F;
|
323 |
+
}
|
324 |
+
if (c >= 0xD800 && c <= 0xDFFF) {
|
325 |
+
throw 'not a UTF-8 string';
|
326 |
+
}
|
327 |
+
if (c > 0x10FFFF) {
|
328 |
+
throw 'not a UTF-8 string';
|
329 |
+
}
|
330 |
+
|
331 |
+
if (c <= 0xFFFF) {
|
332 |
+
str += String.fromCharCode(c);
|
333 |
+
} else {
|
334 |
+
c -= 0x10000;
|
335 |
+
str += String.fromCharCode((c >> 10) + 0xD800);
|
336 |
+
str += String.fromCharCode((c & 0x3FF) + 0xDC00);
|
337 |
+
}
|
338 |
+
}
|
339 |
+
return str;
|
340 |
+
};
|
341 |
+
}
|
342 |
+
|
343 |
+
var encode = function (str, asciiOnly) {
|
344 |
+
var notString = typeof(str) != 'string';
|
345 |
+
if (notString && str.constructor === root.ArrayBuffer) {
|
346 |
+
str = new Uint8Array(str);
|
347 |
+
}
|
348 |
+
if (notString) {
|
349 |
+
return encodeFromBytes(str);
|
350 |
+
} else {
|
351 |
+
if (!asciiOnly && /[^\x00-\x7F]/.test(str)) {
|
352 |
+
return utf8Base64Encode(str);
|
353 |
+
} else {
|
354 |
+
return btoa(str);
|
355 |
+
}
|
356 |
+
}
|
357 |
+
};
|
358 |
+
|
359 |
+
var decode = function (base64Str, asciiOnly) {
|
360 |
+
return asciiOnly ? atob(base64Str) : utf8Base64Decode(base64Str);
|
361 |
+
};
|
362 |
+
|
363 |
+
var exports = {
|
364 |
+
encode: encode,
|
365 |
+
decode: decode,
|
366 |
+
atob: atob,
|
367 |
+
btoa: btoa
|
368 |
+
};
|
369 |
+
decode.bytes = decodeAsBytes;
|
370 |
+
decode.string = decode;
|
371 |
+
|
372 |
+
root.pagelayer_Base64 = exports;
|
373 |
+
})();
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* [hi-base64]{@link https://github.com/emn178/hi-base64}
|
3 |
+
*
|
4 |
+
* @version 0.2.1
|
5 |
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
6 |
+
* @copyright Chen, Yi-Cyuan 2014-2017
|
7 |
+
* @license MIT
|
8 |
+
*/
|
9 |
+
/*jslint bitwise: true */
|
10 |
+
/*Modified by Pagelayer*/
|
11 |
+
!function(){"use strict";var r="object"==typeof window?window:{};!r.HI_BASE64_NO_COMMON_JS&&"object"==typeof module&&module.exports,"function"==typeof define&&define.amd;var t,o,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),n={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63,"-":62,_:63},a=function(r){var t,o,e,a,h=[],f=0,i=r.length;"="===r.charAt(i-2)?i-=2:"="===r.charAt(i-1)&&(i-=1);for(var C=0,c=i>>2<<2;C<c;)t=n[r.charAt(C++)],o=n[r.charAt(C++)],e=n[r.charAt(C++)],a=n[r.charAt(C++)],h[f++]=255&(t<<2|o>>>4),h[f++]=255&(o<<4|e>>>2),h[f++]=255&(e<<6|a);var g=i-c;return 2===g?(t=n[r.charAt(C++)],o=n[r.charAt(C++)],h[f++]=255&(t<<2|o>>>4)):3===g&&(t=n[r.charAt(C++)],o=n[r.charAt(C++)],e=n[r.charAt(C++)],h[f++]=255&(t<<2|o>>>4),h[f++]=255&(o<<4|e>>>2)),h},h=r.btoa,f=r.atob;h?(t=function(r){for(var t="",o=0;o<r.length;o++){var e=r.charCodeAt(o);e<128?t+=String.fromCharCode(e):e<2048?t+=String.fromCharCode(192|e>>6)+String.fromCharCode(128|63&e):e<55296||e>=57344?t+=String.fromCharCode(224|e>>12)+String.fromCharCode(128|e>>6&63)+String.fromCharCode(128|63&e):(e=65536+((1023&e)<<10|1023&r.charCodeAt(++o)),t+=String.fromCharCode(240|e>>18)+String.fromCharCode(128|e>>12&63)+String.fromCharCode(128|e>>6&63)+String.fromCharCode(128|63&e))}return h(t)},o=function(r){var t=f(r.trim("=").replace(/-/g,"+").replace(/_/g,"/"));if(!/[^\x00-\x7F]/.test(t))return t;for(var o,e,n="",a=0,h=t.length,i=0;a<h;)if((o=t.charCodeAt(a++))<=127)n+=String.fromCharCode(o);else{if(o>191&&o<=223)e=31&o,i=1;else if(o<=239)e=15&o,i=2;else{if(!(o<=247))throw"not a UTF-8 string";e=7&o,i=3}for(var C=0;C<i;++C){if((o=t.charCodeAt(a++))<128||o>191)throw"not a UTF-8 string";e<<=6,e+=63&o}if(e>=55296&&e<=57343)throw"not a UTF-8 string";if(e>1114111)throw"not a UTF-8 string";e<=65535?n+=String.fromCharCode(e):(e-=65536,n+=String.fromCharCode(55296+(e>>10)),n+=String.fromCharCode(56320+(1023&e)))}return n}):(h=function(r){for(var t,o,n,a="",h=r.length,f=0,i=3*parseInt(h/3);f<i;)t=r.charCodeAt(f++),o=r.charCodeAt(f++),n=r.charCodeAt(f++),a+=e[t>>>2]+e[63&(t<<4|o>>>4)]+e[63&(o<<2|n>>>6)]+e[63&n];var C=h-i;return 1===C?(t=r.charCodeAt(f),a+=e[t>>>2]+e[t<<4&63]+"=="):2===C&&(t=r.charCodeAt(f++),o=r.charCodeAt(f),a+=e[t>>>2]+e[63&(t<<4|o>>>4)]+e[o<<2&63]+"="),a},t=function(r){for(var t,o,n,a="",h=function(r){for(var t=[],o=0;o<r.length;o++){var e=r.charCodeAt(o);e<128?t[t.length]=e:e<2048?(t[t.length]=192|e>>6,t[t.length]=128|63&e):e<55296||e>=57344?(t[t.length]=224|e>>12,t[t.length]=128|e>>6&63,t[t.length]=128|63&e):(e=65536+((1023&e)<<10|1023&r.charCodeAt(++o)),t[t.length]=240|e>>18,t[t.length]=128|e>>12&63,t[t.length]=128|e>>6&63,t[t.length]=128|63&e)}return t}(r),f=h.length,i=0,C=3*parseInt(f/3);i<C;)t=h[i++],o=h[i++],n=h[i++],a+=e[t>>>2]+e[63&(t<<4|o>>>4)]+e[63&(o<<2|n>>>6)]+e[63&n];var c=f-C;return 1===c?(t=h[i],a+=e[t>>>2]+e[t<<4&63]+"=="):2===c&&(t=h[i++],o=h[i],a+=e[t>>>2]+e[63&(t<<4|o>>>4)]+e[o<<2&63]+"="),a},f=function(r){var t,o,e,a,h="",f=r.length;"="===r.charAt(f-2)?f-=2:"="===r.charAt(f-1)&&(f-=1);for(var i=0,C=f>>2<<2;i<C;)t=n[r.charAt(i++)],o=n[r.charAt(i++)],e=n[r.charAt(i++)],a=n[r.charAt(i++)],h+=String.fromCharCode(255&(t<<2|o>>>4))+String.fromCharCode(255&(o<<4|e>>>2))+String.fromCharCode(255&(e<<6|a));var c=f-C;return 2===c?(t=n[r.charAt(i++)],o=n[r.charAt(i++)],h+=String.fromCharCode(255&(t<<2|o>>>4))):3===c&&(t=n[r.charAt(i++)],o=n[r.charAt(i++)],e=n[r.charAt(i++)],h+=String.fromCharCode(255&(t<<2|o>>>4))+String.fromCharCode(255&(o<<4|e>>>2))),h},o=function(r){for(var t,o,e="",n=a(r),h=n.length,f=0,i=0;f<h;)if((t=n[f++])<=127)e+=String.fromCharCode(t);else{if(t>191&&t<=223)o=31&t,i=1;else if(t<=239)o=15&t,i=2;else{if(!(t<=247))throw"not a UTF-8 string";o=7&t,i=3}for(var C=0;C<i;++C){if((t=n[f++])<128||t>191)throw"not a UTF-8 string";o<<=6,o+=63&t}if(o>=55296&&o<=57343)throw"not a UTF-8 string";if(o>1114111)throw"not a UTF-8 string";o<=65535?e+=String.fromCharCode(o):(o-=65536,e+=String.fromCharCode(55296+(o>>10)),e+=String.fromCharCode(56320+(1023&o)))}return e});var i=function(r,t){return t?f(r):o(r)},C={encode:function(o,n){var a="string"!=typeof o;return a&&o.constructor===r.ArrayBuffer&&(o=new Uint8Array(o)),a?function(r){for(var t,o,n,a="",h=r.length,f=0,i=3*parseInt(h/3);f<i;)t=r[f++],o=r[f++],n=r[f++],a+=e[t>>>2]+e[63&(t<<4|o>>>4)]+e[63&(o<<2|n>>>6)]+e[63&n];var C=h-i;return 1===C?(t=r[f],a+=e[t>>>2]+e[t<<4&63]+"=="):2===C&&(t=r[f++],o=r[f],a+=e[t>>>2]+e[63&(t<<4|o>>>4)]+e[o<<2&63]+"="),a}(o):!n&&/[^\x00-\x7F]/.test(o)?t(o):h(o)},decode:i,atob:f,btoa:h};i.bytes=a,i.string=i,r.pagelayer_Base64=C}();
|
@@ -370,8 +370,10 @@ function pagelayer_pl_accordion(jEle){
|
|
370 |
}
|
371 |
|
372 |
accHolder.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
373 |
-
accHolder.removeClass('active').
|
374 |
-
|
|
|
|
|
375 |
currentTab.addClass('active').children('.pagelayer-accordion-panel').show('slow');
|
376 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', active_icon);
|
377 |
|
@@ -422,7 +424,7 @@ function pagelayer_pl_collapse(jEle){
|
|
422 |
var currentTab = jQuery(this).closest('.pagelayer-accordion_item');
|
423 |
|
424 |
if(currentTab.hasClass('active')){
|
425 |
-
currentTab.removeClass('active').children('.pagelayer-accordion-panel').hide('slow')
|
426 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
427 |
return true;
|
428 |
}
|
@@ -595,7 +597,7 @@ function pagelayer_stars(){
|
|
595 |
i = 0;
|
596 |
var stars = "";
|
597 |
while(i < count){
|
598 |
-
stars +='<div class="pagelayer-stars-icon pagelayer-stars-empty"><i class="
|
599 |
i++;
|
600 |
}
|
601 |
|
370 |
}
|
371 |
|
372 |
accHolder.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
373 |
+
accHolder.removeClass('active').filter(function(index){
|
374 |
+
return accHolder[index]!=currentTab[0];
|
375 |
+
}).children('.pagelayer-accordion-panel').hide('slow');
|
376 |
+
|
377 |
currentTab.addClass('active').children('.pagelayer-accordion-panel').show('slow');
|
378 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', active_icon);
|
379 |
|
424 |
var currentTab = jQuery(this).closest('.pagelayer-accordion_item');
|
425 |
|
426 |
if(currentTab.hasClass('active')){
|
427 |
+
currentTab.removeClass('active').children('.pagelayer-accordion-panel').hide('slow');
|
428 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
429 |
return true;
|
430 |
}
|
597 |
i = 0;
|
598 |
var stars = "";
|
599 |
while(i < count){
|
600 |
+
stars +='<div class="pagelayer-stars-icon pagelayer-stars-empty"><i class="fas fa-star" aria-hidden="true"></i></div>';
|
601 |
i++;
|
602 |
}
|
603 |
|
@@ -30,12 +30,13 @@ jQuery(document).ready(function(){
|
|
30 |
var active_tab_ele = jEle.find('[href="#'+hash+'"]');
|
31 |
if (active_tab_ele.length > 0){
|
32 |
active_tab_ele.click();
|
|
|
33 |
}
|
34 |
-
}else{
|
35 |
-
var first = jEle.find('a').first();
|
36 |
-
first.click();
|
37 |
}
|
38 |
|
|
|
|
|
|
|
39 |
});
|
40 |
}
|
41 |
|
30 |
var active_tab_ele = jEle.find('[href="#'+hash+'"]');
|
31 |
if (active_tab_ele.length > 0){
|
32 |
active_tab_ele.click();
|
33 |
+
return;
|
34 |
}
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
+
var first = jEle.find('a').first();
|
38 |
+
first.click();
|
39 |
+
|
40 |
});
|
41 |
}
|
42 |
|
@@ -947,7 +947,7 @@ function pagelayer_empty_col(selector){
|
|
947 |
// Column is becoming blank, so show add ele
|
948 |
if(jEle.children().length < 1){
|
949 |
//from.addClass('pagelayer-empty-col');
|
950 |
-
jEle.append('<div class="pagelayer-add-ele pagelayer-ele-wrap"><i class="
|
951 |
//var h = jEle.parent().parent().children('.pagelayer-ele-overlay').height();
|
952 |
//jEle.children('.pagelayer-add-ele').height(h);
|
953 |
jEle.find('>.pagelayer-add-ele .fa').unbind('click');
|
@@ -1417,9 +1417,9 @@ function pagelayer_element_setup(selector, render){
|
|
1417 |
}
|
1418 |
|
1419 |
html = '<div class="pagelayer-row-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
|
1420 |
-
'<i class="
|
1421 |
-
'<i class="
|
1422 |
-
'<i class="
|
1423 |
'</div>';
|
1424 |
|
1425 |
}else if(tag == 'pl_col'){
|
@@ -1427,7 +1427,7 @@ function pagelayer_element_setup(selector, render){
|
|
1427 |
overlay.addClass('pagelayer-col-hover');
|
1428 |
|
1429 |
html = '<div class="pagelayer-col-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
|
1430 |
-
'<i class="
|
1431 |
'</div>';
|
1432 |
|
1433 |
// Is it an empty col ?
|
@@ -1439,9 +1439,9 @@ function pagelayer_element_setup(selector, render){
|
|
1439 |
}else{
|
1440 |
|
1441 |
html = '<div class="pagelayer-ele-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
|
1442 |
-
'<i class="
|
1443 |
-
'<i class="
|
1444 |
-
'<i class="
|
1445 |
'</div>';
|
1446 |
|
1447 |
}
|
@@ -1547,13 +1547,13 @@ function pagelayer_right_click(){
|
|
1547 |
var html = '<div class="pagelayer-right-click-options" style="display:none;">'+
|
1548 |
'<ul>'+
|
1549 |
'<li><a class="pagelayer-right-edit">Edit</a></li>'+
|
1550 |
-
'<li><a class="pagelayer-right-duplicate"><i class="
|
1551 |
-
'<li><a class="pagelayer-right-copy"><i class="
|
1552 |
-
'<li><a class="pagelayer-right-paste"><i class="
|
1553 |
-
'<li><a class="pagelayer-right-delete"><i class="
|
1554 |
-
'<li><a class="pagelayer-right-save-global-widget" pro="1"><i class="
|
1555 |
-
'<li><a class="pagelayer-right-save-section" pro="1"><i class="
|
1556 |
-
'<li><a class="pagelayer-right-save-global-section" pro="1"><i class="
|
1557 |
'</ul>'+
|
1558 |
'</div>';
|
1559 |
|
@@ -1578,7 +1578,7 @@ function pagelayer_right_click(){
|
|
1578 |
var id = pagelayer_assign_id(jEle);
|
1579 |
var tag = pagelayer_tag(jEle);
|
1580 |
|
1581 |
-
$contextMenu.find('.pagelayer-right-edit').attr('onclick', 'pagelayer_edit_element("[pagelayer-id='+id+']")').html('<i class="
|
1582 |
$contextMenu.find('.pagelayer-right-duplicate').attr('onclick', 'pagelayer_copy_element("[pagelayer-id='+id+']")');
|
1583 |
$contextMenu.find('.pagelayer-right-copy').attr('onclick', 'pagelayer_copy_select("[pagelayer-id='+id+']")');
|
1584 |
$contextMenu.find('.pagelayer-right-paste').attr('onclick', 'pagelayer_paste_element("[pagelayer-id='+id+']")');
|
@@ -2171,6 +2171,7 @@ function pagelayer_save_sections(sel, section = 'section'){
|
|
2171 |
data[0]['post_type'] = 'pagelayer-template';
|
2172 |
data[0]['type'] = section;
|
2173 |
data[0]['content'] = content.replace(/pagelayer-id="(.*?)"/g, ""); // Need to remove pagelayer id,
|
|
|
2174 |
|
2175 |
// This function for ajax success call back of global widget
|
2176 |
pagelayer_ajax_func['global_widget'] = function(obj){
|
@@ -2243,7 +2244,7 @@ function pagelayer_generate_sc_global_widget(){
|
|
2243 |
content = content.replace(/pagelayer-id="(.*?)"/g, "");
|
2244 |
}
|
2245 |
|
2246 |
-
global_widgets[y]['content'] = content;
|
2247 |
pagelayer_global_widgets[y]['is_dirty'] = false;
|
2248 |
}
|
2249 |
|
@@ -3302,7 +3303,7 @@ function pagelayer_save(){
|
|
3302 |
type: "POST",
|
3303 |
url: pagelayerajaxurl,
|
3304 |
data: {
|
3305 |
-
pagelayer_update_content : post,
|
3306 |
pagelayer_nonce: pagelayer_ajax_nonce,
|
3307 |
global_widgets: global_data,
|
3308 |
contacts: contacts_props,
|
@@ -3321,8 +3322,9 @@ function pagelayer_save(){
|
|
3321 |
pagelayer_get_revision();
|
3322 |
}
|
3323 |
},
|
3324 |
-
error: function(errorThrown){
|
3325 |
console.log(errorThrown);
|
|
|
3326 |
},
|
3327 |
complete: function(xhr,status){
|
3328 |
pagelayer.$$('.pagelayer-update-text').show();
|
@@ -3531,7 +3533,7 @@ function pagelayer_leftbar(){
|
|
3531 |
'</div>'+
|
3532 |
'<div class="pagelayer-shortcodes-widget">'+
|
3533 |
'<div class="pagelayer-leftbar-search">'+
|
3534 |
-
'<i class="pli pli-search"
|
3535 |
'</div>';
|
3536 |
|
3537 |
for(var x in pagelayer_groups){
|
@@ -3688,7 +3690,7 @@ function pagelayer_leftbar(){
|
|
3688 |
|
3689 |
gHtml += '<div class="pagelayer-global-widget-shortcodes">'+
|
3690 |
'<div class="pagelayer-leftbar-search">'+
|
3691 |
-
'<i class="pli pli-search"
|
3692 |
'</div>'+
|
3693 |
'<div class="pagelayer-leftbar-group"><h5>'+pagelayer_l('global_widgets')+'</h5></div>'+
|
3694 |
'</div>';
|
@@ -4412,7 +4414,7 @@ function pagelayer_bottombar(){
|
|
4412 |
type: 'POST',
|
4413 |
data: {
|
4414 |
'pagelayer_nonce': pagelayer_ajax_nonce,
|
4415 |
-
'pagelayer_post_content': post
|
4416 |
},
|
4417 |
success: function(data) {
|
4418 |
var data = JSON.parse(data);
|
@@ -4709,8 +4711,8 @@ function pagelayer_video_url(src){
|
|
4709 |
function pagelayer_add_widget(){
|
4710 |
|
4711 |
html='<div class="pagelayer-add-widget-area">'+
|
4712 |
-
'<button class="pagelayer-add-button pagelayer-add-section"><i class="pagelayer-add-row
|
4713 |
-
'<button class="pagelayer-add-button pagelayer-add-row"><i class="pagelayer-add-row
|
4714 |
'<p>Click here to add new row OR drag widgets</p>'+
|
4715 |
'</div>';
|
4716 |
|
@@ -4868,7 +4870,7 @@ function pagelayer_add_section_area(){
|
|
4868 |
'<div class="pagelayer-add-section-modal-row">'+
|
4869 |
'<div class="pagelayer-add-section-modal-left">'+
|
4870 |
'<div class="pagelayer-section-search-div">'+
|
4871 |
-
'<i class="pli pli-search"
|
4872 |
'</div>'+
|
4873 |
'<div class="pagelayer-section-tags-holder"></div>'+
|
4874 |
'</div>'+
|
947 |
// Column is becoming blank, so show add ele
|
948 |
if(jEle.children().length < 1){
|
949 |
//from.addClass('pagelayer-empty-col');
|
950 |
+
jEle.append('<div class="pagelayer-add-ele pagelayer-ele-wrap"><i class="fas fa-plus"></i><br /><span>Empty column please Drag Widgets</span></div>');
|
951 |
//var h = jEle.parent().parent().children('.pagelayer-ele-overlay').height();
|
952 |
//jEle.children('.pagelayer-add-ele').height(h);
|
953 |
jEle.find('>.pagelayer-add-ele .fa').unbind('click');
|
1417 |
}
|
1418 |
|
1419 |
html = '<div class="pagelayer-row-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
|
1420 |
+
'<i class="far fa-clone pagelayer-eoi" onclick="pagelayer_copy_element(\''+selector+'\')" ></i>'+
|
1421 |
+
'<i class="fas fa-trash pagelayer-eoi" onclick="pagelayer_delete_element(\''+selector+'\')" ></i>'+
|
1422 |
+
'<i class="fas fa-pencil-alt pagelayer-eoi" onclick="pagelayer_edit_element(\''+selector+'\', event)" ></i>'+
|
1423 |
'</div>';
|
1424 |
|
1425 |
}else if(tag == 'pl_col'){
|
1427 |
overlay.addClass('pagelayer-col-hover');
|
1428 |
|
1429 |
html = '<div class="pagelayer-col-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
|
1430 |
+
'<i class="fas fa-columns pagelayer-eoi" onclick="pagelayer_edit_element(\''+selector+'\', event)" ></i>'+
|
1431 |
'</div>';
|
1432 |
|
1433 |
// Is it an empty col ?
|
1439 |
}else{
|
1440 |
|
1441 |
html = '<div class="pagelayer-ele-option" pagelayer-option-edit pagelayer-option-id="'+id+'">'+
|
1442 |
+
'<i class="far fa-clone pagelayer-eoi" onclick="pagelayer_copy_element(\''+selector+'\')" ></i>'+
|
1443 |
+
'<i class="fas fa-trash pagelayer-eoi" onclick="pagelayer_delete_element(\''+selector+'\')" ></i>'+
|
1444 |
+
'<i class="fas fa-pencil-alt pagelayer-eoi" onclick="pagelayer_edit_element(\''+selector+'\', event)" ></i>'+
|
1445 |
'</div>';
|
1446 |
|
1447 |
}
|
1547 |
var html = '<div class="pagelayer-right-click-options" style="display:none;">'+
|
1548 |
'<ul>'+
|
1549 |
'<li><a class="pagelayer-right-edit">Edit</a></li>'+
|
1550 |
+
'<li><a class="pagelayer-right-duplicate"><i class="far fa-clone" ></i> '+pagelayer_l('Duplicate')+'</a></li>'+
|
1551 |
+
'<li><a class="pagelayer-right-copy"><i class="far fa-copy" ></i> '+pagelayer_l('Copy')+'</a></li>'+
|
1552 |
+
'<li><a class="pagelayer-right-paste"><i class="far fa-clipboard" ></i> '+pagelayer_l('Paste')+'</a></li>'+
|
1553 |
+
'<li><a class="pagelayer-right-delete"><i class="far fa-trash-alt" ></i> '+pagelayer_l('Delete')+'</a></li>'+
|
1554 |
+
'<li><a class="pagelayer-right-save-global-widget" pro="1"><i class="far fa-save" ></i> '+pagelayer_l('save_global')+'</a></li>'+
|
1555 |
+
'<li><a class="pagelayer-right-save-section" pro="1"><i class="far fa-heart" ></i> '+pagelayer_l('save_as_section')+'</a></li>'+
|
1556 |
+
'<li><a class="pagelayer-right-save-global-section" pro="1"><i class="fas fa-globe" ></i> '+pagelayer_l('save_as_global_section')+'</a></li>'+
|
1557 |
'</ul>'+
|
1558 |
'</div>';
|
1559 |
|
1578 |
var id = pagelayer_assign_id(jEle);
|
1579 |
var tag = pagelayer_tag(jEle);
|
1580 |
|
1581 |
+
$contextMenu.find('.pagelayer-right-edit').attr('onclick', 'pagelayer_edit_element("[pagelayer-id='+id+']")').html('<i class="far fa-edit" ></i> Edit '+pagelayer_shortcodes[tag]['name']);
|
1582 |
$contextMenu.find('.pagelayer-right-duplicate').attr('onclick', 'pagelayer_copy_element("[pagelayer-id='+id+']")');
|
1583 |
$contextMenu.find('.pagelayer-right-copy').attr('onclick', 'pagelayer_copy_select("[pagelayer-id='+id+']")');
|
1584 |
$contextMenu.find('.pagelayer-right-paste').attr('onclick', 'pagelayer_paste_element("[pagelayer-id='+id+']")');
|
2171 |
data[0]['post_type'] = 'pagelayer-template';
|
2172 |
data[0]['type'] = section;
|
2173 |
data[0]['content'] = content.replace(/pagelayer-id="(.*?)"/g, ""); // Need to remove pagelayer id,
|
2174 |
+
data[0]['content'] = pagelayer_Base64.encode(data[0]['content']);
|
2175 |
|
2176 |
// This function for ajax success call back of global widget
|
2177 |
pagelayer_ajax_func['global_widget'] = function(obj){
|
2244 |
content = content.replace(/pagelayer-id="(.*?)"/g, "");
|
2245 |
}
|
2246 |
|
2247 |
+
global_widgets[y]['content'] = pagelayer_Base64.encode(content);
|
2248 |
pagelayer_global_widgets[y]['is_dirty'] = false;
|
2249 |
}
|
2250 |
|
3303 |
type: "POST",
|
3304 |
url: pagelayerajaxurl,
|
3305 |
data: {
|
3306 |
+
pagelayer_update_content : pagelayer_Base64.encode(post),
|
3307 |
pagelayer_nonce: pagelayer_ajax_nonce,
|
3308 |
global_widgets: global_data,
|
3309 |
contacts: contacts_props,
|
3322 |
pagelayer_get_revision();
|
3323 |
}
|
3324 |
},
|
3325 |
+
error: function(jqXHR, textStatus, errorThrown){
|
3326 |
console.log(errorThrown);
|
3327 |
+
alert('An error occured while saving ! Status : '+textStatus+' and Error : '+errorThrown);
|
3328 |
},
|
3329 |
complete: function(xhr,status){
|
3330 |
pagelayer.$$('.pagelayer-update-text').show();
|
3533 |
'</div>'+
|
3534 |
'<div class="pagelayer-shortcodes-widget">'+
|
3535 |
'<div class="pagelayer-leftbar-search">'+
|
3536 |
+
'<i class="pli pli-search" ></i><input class="pagelayer-search-field" /><span class="pagelayer-sf-empty pli">×</span>'+
|
3537 |
'</div>';
|
3538 |
|
3539 |
for(var x in pagelayer_groups){
|
3690 |
|
3691 |
gHtml += '<div class="pagelayer-global-widget-shortcodes">'+
|
3692 |
'<div class="pagelayer-leftbar-search">'+
|
3693 |
+
'<i class="pli pli-search" ></i><input class="pagelayer-search-field" /><i class="pagelayer-sf-empty pli">×</i>'+
|
3694 |
'</div>'+
|
3695 |
'<div class="pagelayer-leftbar-group"><h5>'+pagelayer_l('global_widgets')+'</h5></div>'+
|
3696 |
'</div>';
|
4414 |
type: 'POST',
|
4415 |
data: {
|
4416 |
'pagelayer_nonce': pagelayer_ajax_nonce,
|
4417 |
+
'pagelayer_post_content': pagelayer_Base64.encode(post)
|
4418 |
},
|
4419 |
success: function(data) {
|
4420 |
var data = JSON.parse(data);
|
4711 |
function pagelayer_add_widget(){
|
4712 |
|
4713 |
html='<div class="pagelayer-add-widget-area">'+
|
4714 |
+
'<button class="pagelayer-add-button pagelayer-add-section"><i class="pagelayer-add-row fas fa-file-alt"></i> Add New Section</button>'+
|
4715 |
+
'<button class="pagelayer-add-button pagelayer-add-row"><i class="pagelayer-add-row fas fa-plus-circle"></i> Add New Row</button>'+
|
4716 |
'<p>Click here to add new row OR drag widgets</p>'+
|
4717 |
'</div>';
|
4718 |
|
4870 |
'<div class="pagelayer-add-section-modal-row">'+
|
4871 |
'<div class="pagelayer-add-section-modal-left">'+
|
4872 |
'<div class="pagelayer-section-search-div">'+
|
4873 |
+
'<i class="pli pli-search" ></i><input class="pagelayer-section-search" /><span class="pagelayer-sf-empty pli">×</span>'+
|
4874 |
'</div>'+
|
4875 |
'<div class="pagelayer-section-tags-holder"></div>'+
|
4876 |
'</div>'+
|
@@ -370,8 +370,10 @@ function pagelayer_pl_accordion(jEle){
|
|
370 |
}
|
371 |
|
372 |
accHolder.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
373 |
-
accHolder.removeClass('active').
|
374 |
-
|
|
|
|
|
375 |
currentTab.addClass('active').children('.pagelayer-accordion-panel').show('slow');
|
376 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', active_icon);
|
377 |
|
@@ -422,7 +424,7 @@ function pagelayer_pl_collapse(jEle){
|
|
422 |
var currentTab = jQuery(this).closest('.pagelayer-accordion_item');
|
423 |
|
424 |
if(currentTab.hasClass('active')){
|
425 |
-
currentTab.removeClass('active').children('.pagelayer-accordion-panel').hide('slow')
|
426 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
427 |
return true;
|
428 |
}
|
@@ -595,7 +597,7 @@ function pagelayer_stars(){
|
|
595 |
i = 0;
|
596 |
var stars = "";
|
597 |
while(i < count){
|
598 |
-
stars +='<div class="pagelayer-stars-icon pagelayer-stars-empty"><i class="
|
599 |
i++;
|
600 |
}
|
601 |
|
370 |
}
|
371 |
|
372 |
accHolder.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
373 |
+
accHolder.removeClass('active').filter(function(index){
|
374 |
+
return accHolder[index]!=currentTab[0];
|
375 |
+
}).children('.pagelayer-accordion-panel').hide('slow');
|
376 |
+
|
377 |
currentTab.addClass('active').children('.pagelayer-accordion-panel').show('slow');
|
378 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', active_icon);
|
379 |
|
424 |
var currentTab = jQuery(this).closest('.pagelayer-accordion_item');
|
425 |
|
426 |
if(currentTab.hasClass('active')){
|
427 |
+
currentTab.removeClass('active').children('.pagelayer-accordion-panel').hide('slow');
|
428 |
currentTab.find('.pagelayer-accordion-tabs span i').attr('class', icon);
|
429 |
return true;
|
430 |
}
|
597 |
i = 0;
|
598 |
var stars = "";
|
599 |
while(i < count){
|
600 |
+
stars +='<div class="pagelayer-stars-icon pagelayer-stars-empty"><i class="fas fa-star" aria-hidden="true"></i></div>';
|
601 |
i++;
|
602 |
}
|
603 |
|
@@ -189,8 +189,8 @@ function pagelayer_elpd_setup(){
|
|
189 |
//'<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="styles">Style</div>'+
|
190 |
'<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="options">Options</div>'+
|
191 |
'<div class="pagelayer-elpd-options">'+
|
192 |
-
'<i class="pli pli-clone"
|
193 |
-
'<i class="pli pli-trashcan"
|
194 |
'</div>'+
|
195 |
'</div>'+
|
196 |
'<div class="pagelayer-elpd-body"></div>'+
|
@@ -793,7 +793,7 @@ function _pagelayer_get_tmp_att(row, suffix){
|
|
793 |
|
794 |
// Create the Label
|
795 |
function pagelayer_elp_label(row, prop){
|
796 |
-
row.append('<div class="pagelayer-elp-label-div"><label class="pagelayer-elp-label">'+prop['label']+'</label></div>');
|
797 |
|
798 |
var label = row.children('.pagelayer-elp-label-div');
|
799 |
|
@@ -801,10 +801,10 @@ function pagelayer_elp_label(row, prop){
|
|
801 |
if('screen' in prop){
|
802 |
var mode = pagelayer_get_screen_mode();
|
803 |
var screen = '<div class="pagelayer-elp-screen">'+
|
804 |
-
'<i class="pli pli-desktop"
|
805 |
-
'<i class="pli pli-tablet"
|
806 |
-
'<i class="pli pli-mobile"
|
807 |
-
'<i class="pagelayer-prop-screen pli pli-'+mode+'"
|
808 |
'</div>';
|
809 |
label.append(screen);
|
810 |
|
@@ -1143,7 +1143,7 @@ function pagelayer_elp_image(row, prop){
|
|
1143 |
var div = '<div class="pagelayer-elp-image-div">'+
|
1144 |
'<div class="pagelayer-elp-drop-zone">'+
|
1145 |
'<div>'+
|
1146 |
-
'<i class="
|
1147 |
'<h4>'+pagelayer_l('drop_file')+'</h4>'+
|
1148 |
'<div class="pagelayer-elp-img-up-progress">'+
|
1149 |
'<div class="pagelayer-elp-img-up-bar"></div>'+
|
@@ -1151,7 +1151,7 @@ function pagelayer_elp_image(row, prop){
|
|
1151 |
'</div>'+
|
1152 |
'</div>'+
|
1153 |
'<div class="pagelayer-elp-image" '+style+'></div>'+
|
1154 |
-
'<div class="pagelayer-elp-image-delete"><i class="pli pli-trashcan"
|
1155 |
'</div>';
|
1156 |
|
1157 |
row.append(div);
|
@@ -1542,7 +1542,7 @@ function pagelayer_elp_video(row, prop){
|
|
1542 |
|
1543 |
var div = '<div class="pagelayer-elp-video-div pagelayer-elp-input-icon">'+
|
1544 |
'<input class="pagelayer-elp-video" name="'+prop.c['name']+'" type="text" value="'+src+'">'+
|
1545 |
-
'<i class="pli pli-folder-open"
|
1546 |
'</input></div>';
|
1547 |
|
1548 |
row.append(div);
|
@@ -1617,7 +1617,7 @@ function pagelayer_elp_audio(row, prop){
|
|
1617 |
|
1618 |
var div = '<div class="pagelayer-elp-audio-div pagelayer-elp-input-icon">'+
|
1619 |
'<input class="pagelayer-elp-audio" name="'+prop.c['name']+'" type="text" value="'+src+'" />'+
|
1620 |
-
'<i class="pli pli-menu"
|
1621 |
'</div>';
|
1622 |
|
1623 |
row.append(div);
|
@@ -1691,7 +1691,7 @@ function pagelayer_elp_media(row, prop){
|
|
1691 |
|
1692 |
var div = '<div class="pagelayer-elp-media-div pagelayer-elp-input-icon">'+
|
1693 |
'<input class="pagelayer-elp-media" value="'+src+'" type="text" />'+
|
1694 |
-
'<i class="pli pli-menu"
|
1695 |
'</div>';
|
1696 |
|
1697 |
row.append(div);
|
@@ -1843,7 +1843,7 @@ function pagelayer_elp_link(row, prop){
|
|
1843 |
|
1844 |
var div = '<div class="pagelayer-elp-link-div pagelayer-elp-input-icon">'+
|
1845 |
'<input class="pagelayer-elp-link" type="text" value="'+link+'" />'+
|
1846 |
-
'<i class="pli pli-link pagelayer-elp-link-icon"
|
1847 |
'<div class="pagelayer-elp-link-list">'+
|
1848 |
'</div>'+
|
1849 |
'</div>';
|
@@ -2133,7 +2133,7 @@ function pagelayer_elp_icon(row, prop){
|
|
2133 |
// Icon function
|
2134 |
var icon_html = function(name, cat){
|
2135 |
return '<span class="pagelayer-elp-icon-span">'+
|
2136 |
-
'<i class="'+cat+' fa-'+name+'" icon="'+name+'"
|
2137 |
'</span>';
|
2138 |
}
|
2139 |
|
@@ -2283,7 +2283,7 @@ function pagelayer_elp_icon(row, prop){
|
|
2283 |
function pagelayer_elp_access(row, prop){
|
2284 |
|
2285 |
var div = '<div class="pagelayer-elp-access-div">'+
|
2286 |
-
'<span class="pagelayer-elp-access"><i class="pli pli-caret-right"
|
2287 |
'<div class="pagelayer-elp-access-holder"></div>'+
|
2288 |
'</div>';
|
2289 |
|
@@ -2318,7 +2318,7 @@ function pagelayer_elp_modal(row, prop){
|
|
2318 |
var style = pagelayer_empty(prop.width) ? '' : 'style="width:'+prop.width+'"';
|
2319 |
|
2320 |
var div = '<div class="pagelayer-elp-modal-div">'+
|
2321 |
-
'<span class="pagelayer-elp-modal"><i class="pli pli-window"
|
2322 |
'<div class="pagelayer-elp-modal-wrapper">'+
|
2323 |
'<div class="pagelayer-elp-modal-wrap" '+style+'>'+
|
2324 |
'<div class="pagelayer-elp-modal-header">'+
|
@@ -2372,7 +2372,7 @@ function pagelayer_elp_color(row, prop){
|
|
2372 |
|
2373 |
var div = '<div class="pagelayer-elp-color-div">'+
|
2374 |
'<div class="pagelayer-elp-color-preview"></div>'+
|
2375 |
-
'<span class="pagelayer-elp-remove-color"><i class="pli pli-cross"
|
2376 |
'</div>';
|
2377 |
|
2378 |
row.append(div);
|
@@ -2508,10 +2508,10 @@ function pagelayer_elp_group(row, prop){
|
|
2508 |
// Create the HTML
|
2509 |
var holder = jQuery('<div class="pagelayer-elp-group-item" pagelayer-group-item-id="'+id+'">'+
|
2510 |
'<div class="pagelayer-elp-group-item-head">'+
|
2511 |
-
'<span class="pagelayer-elp-group-item-drag"><i class="pli pli-menu"
|
2512 |
'<span class="pagelayer-elp-group-item-title">'+title+'</span>'+
|
2513 |
-
'<span class="pagelayer-elp-group-item-clone '+btnHidden+'"><i class="pli pli-clone"
|
2514 |
-
'<span class="pagelayer-elp-group-item-del '+btnHidden+'"><i class="pli pli-trashcan"
|
2515 |
'</div>'+
|
2516 |
'<div class="pagelayer-elp-group-item-body"></div>'+
|
2517 |
'</div>');
|
@@ -2678,7 +2678,7 @@ function pagelayer_elp_padding(row, prop){
|
|
2678 |
'<input type="number" class="pagelayer-elp-padding" value="'+parseFloat(val[1])+'"></input>'+
|
2679 |
'<input type="number" class="pagelayer-elp-padding" value="'+parseFloat(val[2])+'"></input>'+
|
2680 |
'<input type="number" class="pagelayer-elp-padding" value="'+parseFloat(val[3])+'"></input>'+
|
2681 |
-
'<i class="pli pli-link"
|
2682 |
'</div>';
|
2683 |
|
2684 |
row.append(div);
|
@@ -2773,7 +2773,7 @@ function pagelayer_elp_shadow(row, prop){
|
|
2773 |
'<label class="pagelayer-elp-label">Color</label>'+
|
2774 |
'<div class="pagelayer-elp-color-div">'+
|
2775 |
'<div class="pagelayer-elp-color-preview"></div>'+
|
2776 |
-
'<span class="pagelayer-elp-remove-color"><i class="pli pli-cross"
|
2777 |
'</div>'+
|
2778 |
'</div>'+
|
2779 |
'</div>';
|
@@ -2873,7 +2873,7 @@ function pagelayer_elp_box_shadow(row, prop){
|
|
2873 |
'<label class="pagelayer-elp-label">Color</label>'+
|
2874 |
'<div class="pagelayer-elp-color-div">'+
|
2875 |
'<div class="pagelayer-elp-color-preview"></div>'+
|
2876 |
-
'<span class="pagelayer-elp-remove-color"><i class="pli pli-cross"
|
2877 |
'</div>'+
|
2878 |
'</div>'+
|
2879 |
'<div class="pagelayer-elp-prop-grp pagelayer-elp-shadow-inset">'+
|
@@ -3367,7 +3367,7 @@ function pagelayer_elp_dimension(row, prop){
|
|
3367 |
var div = '<div class="pagelayer-elp-dimension-div">'+
|
3368 |
'<input type="number" class="pagelayer-elp-dimension" value="'+parseFloat(val[0])+'"></input>'+
|
3369 |
'<input type="number" class="pagelayer-elp-dimension" value="'+parseFloat(val[1])+'"></input>'+
|
3370 |
-
'<i class="pli pli-link"
|
3371 |
'</div>';
|
3372 |
|
3373 |
row.append(div);
|
189 |
//'<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="styles">Style</div>'+
|
190 |
'<div class="pagelayer-elpd-tab" pagelayer-elpd-tab="options">Options</div>'+
|
191 |
'<div class="pagelayer-elpd-options">'+
|
192 |
+
'<i class="pli pli-clone" ></i>'+
|
193 |
+
'<i class="pli pli-trashcan" ></i>'+
|
194 |
'</div>'+
|
195 |
'</div>'+
|
196 |
'<div class="pagelayer-elpd-body"></div>'+
|
793 |
|
794 |
// Create the Label
|
795 |
function pagelayer_elp_label(row, prop){
|
796 |
+
row.append('<div class="pagelayer-elp-label-div" type="'+prop['type']+'"><label class="pagelayer-elp-label">'+prop['label']+'</label></div>');
|
797 |
|
798 |
var label = row.children('.pagelayer-elp-label-div');
|
799 |
|
801 |
if('screen' in prop){
|
802 |
var mode = pagelayer_get_screen_mode();
|
803 |
var screen = '<div class="pagelayer-elp-screen">'+
|
804 |
+
'<i class="pli pli-desktop" ></i>'+
|
805 |
+
'<i class="pli pli-tablet" ></i>'+
|
806 |
+
'<i class="pli pli-mobile" ></i>'+
|
807 |
+
'<i class="pagelayer-prop-screen pli pli-'+mode+'" ></i>'+
|
808 |
'</div>';
|
809 |
label.append(screen);
|
810 |
|
1143 |
var div = '<div class="pagelayer-elp-image-div">'+
|
1144 |
'<div class="pagelayer-elp-drop-zone">'+
|
1145 |
'<div>'+
|
1146 |
+
'<i class="fas fa-upload"></i>'+
|
1147 |
'<h4>'+pagelayer_l('drop_file')+'</h4>'+
|
1148 |
'<div class="pagelayer-elp-img-up-progress">'+
|
1149 |
'<div class="pagelayer-elp-img-up-bar"></div>'+
|
1151 |
'</div>'+
|
1152 |
'</div>'+
|
1153 |
'<div class="pagelayer-elp-image" '+style+'></div>'+
|
1154 |
+
'<div class="pagelayer-elp-image-delete"><i class="pli pli-trashcan" ></i></div>'+
|
1155 |
'</div>';
|
1156 |
|
1157 |
row.append(div);
|
1542 |
|
1543 |
var div = '<div class="pagelayer-elp-video-div pagelayer-elp-input-icon">'+
|
1544 |
'<input class="pagelayer-elp-video" name="'+prop.c['name']+'" type="text" value="'+src+'">'+
|
1545 |
+
'<i class="pli pli-folder-open" ></i>'+
|
1546 |
'</input></div>';
|
1547 |
|
1548 |
row.append(div);
|
1617 |
|
1618 |
var div = '<div class="pagelayer-elp-audio-div pagelayer-elp-input-icon">'+
|
1619 |
'<input class="pagelayer-elp-audio" name="'+prop.c['name']+'" type="text" value="'+src+'" />'+
|
1620 |
+
'<i class="pli pli-menu" ></i>'+
|
1621 |
'</div>';
|
1622 |
|
1623 |
row.append(div);
|
1691 |
|
1692 |
var div = '<div class="pagelayer-elp-media-div pagelayer-elp-input-icon">'+
|
1693 |
'<input class="pagelayer-elp-media" value="'+src+'" type="text" />'+
|
1694 |
+
'<i class="pli pli-menu" ></i>'+
|
1695 |
'</div>';
|
1696 |
|
1697 |
row.append(div);
|
1843 |
|
1844 |
var div = '<div class="pagelayer-elp-link-div pagelayer-elp-input-icon">'+
|
1845 |
'<input class="pagelayer-elp-link" type="text" value="'+link+'" />'+
|
1846 |
+
'<i class="pli pli-link pagelayer-elp-link-icon" ></i>'+
|
1847 |
'<div class="pagelayer-elp-link-list">'+
|
1848 |
'</div>'+
|
1849 |
'</div>';
|
2133 |
// Icon function
|
2134 |
var icon_html = function(name, cat){
|
2135 |
return '<span class="pagelayer-elp-icon-span">'+
|
2136 |
+
'<i class="'+cat+' fa-'+name+'" icon="'+name+'" ></i> '+name+
|
2137 |
'</span>';
|
2138 |
}
|
2139 |
|
2283 |
function pagelayer_elp_access(row, prop){
|
2284 |
|
2285 |
var div = '<div class="pagelayer-elp-access-div">'+
|
2286 |
+
'<span class="pagelayer-elp-access"><i class="pli pli-caret-right" ></i></span>'+
|
2287 |
'<div class="pagelayer-elp-access-holder"></div>'+
|
2288 |
'</div>';
|
2289 |
|
2318 |
var style = pagelayer_empty(prop.width) ? '' : 'style="width:'+prop.width+'"';
|
2319 |
|
2320 |
var div = '<div class="pagelayer-elp-modal-div">'+
|
2321 |
+
'<span class="pagelayer-elp-modal"><i class="pli pli-window" ></i></span>'+
|
2322 |
'<div class="pagelayer-elp-modal-wrapper">'+
|
2323 |
'<div class="pagelayer-elp-modal-wrap" '+style+'>'+
|
2324 |
'<div class="pagelayer-elp-modal-header">'+
|
2372 |
|
2373 |
var div = '<div class="pagelayer-elp-color-div">'+
|
2374 |
'<div class="pagelayer-elp-color-preview"></div>'+
|
2375 |
+
'<span class="pagelayer-elp-remove-color"><i class="pli pli-cross" ></i></span>'+
|
2376 |
'</div>';
|
2377 |
|
2378 |
row.append(div);
|
2508 |
// Create the HTML
|
2509 |
var holder = jQuery('<div class="pagelayer-elp-group-item" pagelayer-group-item-id="'+id+'">'+
|
2510 |
'<div class="pagelayer-elp-group-item-head">'+
|
2511 |
+
'<span class="pagelayer-elp-group-item-drag"><i class="pli pli-menu" ></i></span>'+
|
2512 |
'<span class="pagelayer-elp-group-item-title">'+title+'</span>'+
|
2513 |
+
'<span class="pagelayer-elp-group-item-clone '+btnHidden+'"><i class="pli pli-clone" ></i></span>'+
|
2514 |
+
'<span class="pagelayer-elp-group-item-del '+btnHidden+'"><i class="pli pli-trashcan" ></i></span>'+
|
2515 |
'</div>'+
|
2516 |
'<div class="pagelayer-elp-group-item-body"></div>'+
|
2517 |
'</div>');
|
2678 |
'<input type="number" class="pagelayer-elp-padding" value="'+parseFloat(val[1])+'"></input>'+
|
2679 |
'<input type="number" class="pagelayer-elp-padding" value="'+parseFloat(val[2])+'"></input>'+
|
2680 |
'<input type="number" class="pagelayer-elp-padding" value="'+parseFloat(val[3])+'"></input>'+
|
2681 |
+
'<i class="pli pli-link" ></i>'+
|
2682 |
'</div>';
|
2683 |
|
2684 |
row.append(div);
|
2773 |
'<label class="pagelayer-elp-label">Color</label>'+
|
2774 |
'<div class="pagelayer-elp-color-div">'+
|
2775 |
'<div class="pagelayer-elp-color-preview"></div>'+
|
2776 |
+
'<span class="pagelayer-elp-remove-color"><i class="pli pli-cross" ></i></span>'+
|
2777 |
'</div>'+
|
2778 |
'</div>'+
|
2779 |
'</div>';
|
2873 |
'<label class="pagelayer-elp-label">Color</label>'+
|
2874 |
'<div class="pagelayer-elp-color-div">'+
|
2875 |
'<div class="pagelayer-elp-color-preview"></div>'+
|
2876 |
+
'<span class="pagelayer-elp-remove-color"><i class="pli pli-cross" ></i></span>'+
|
2877 |
'</div>'+
|
2878 |
'</div>'+
|
2879 |
'<div class="pagelayer-elp-prop-grp pagelayer-elp-shadow-inset">'+
|
3367 |
var div = '<div class="pagelayer-elp-dimension-div">'+
|
3368 |
'<input type="number" class="pagelayer-elp-dimension" value="'+parseFloat(val[0])+'"></input>'+
|
3369 |
'<input type="number" class="pagelayer-elp-dimension" value="'+parseFloat(val[1])+'"></input>'+
|
3370 |
+
'<i class="pli pli-link" ></i>'+
|
3371 |
'</div>';
|
3372 |
|
3373 |
row.append(div);
|
@@ -127,11 +127,11 @@ function pagelayer_bg_video(el){
|
|
127 |
videoId = src.split('.be/');
|
128 |
}
|
129 |
//console.log(frame_height);
|
130 |
-
el.atts['vid_src'] = '<iframe src="'+iframe_src+'autoplay=1&controls=0&showinfo=0&rel=0&autohide=1&playlist='+videoId[1]+'" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
131 |
|
132 |
} else if (vimeoRegExp.exec(src)) {
|
133 |
|
134 |
-
el.atts['vid_src'] = '<iframe src="'+iframe_src+'background=1&autoplay=1&byline=0&title=0" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
135 |
|
136 |
}else{
|
137 |
|
@@ -287,7 +287,7 @@ function pagelayer_preDAndD_image(jEle){
|
|
287 |
|
288 |
var dropDiv = '<div class="pagelayer-image-drop-zone">'+
|
289 |
'<div>'+
|
290 |
-
'<i class="
|
291 |
'<h4>'+pagelayer_l('drop_file')+'</h4>'+
|
292 |
'<div class="pagelayer-img-up-progress">'+
|
293 |
'<div class="pagelayer-img-up-bar"></div>'+
|
@@ -435,6 +435,7 @@ function pagelayer_render_pl_image_slider(el){
|
|
435 |
// The URLs
|
436 |
var img_urls = !pagelayer_empty(el.tmp['ids-urls']) ? JSON.parse(el.tmp['ids-urls']) : [];
|
437 |
var all_urls = !pagelayer_empty(el.tmp['ids-all-urls']) ? JSON.parse(el.tmp['ids-all-urls']) : [];
|
|
|
438 |
//console.log(img_urls);
|
439 |
|
440 |
var ul = '';
|
@@ -458,7 +459,7 @@ function pagelayer_render_pl_image_slider(el){
|
|
458 |
ul += '<a href="'+link+'">';
|
459 |
}
|
460 |
|
461 |
-
ul += '<img class="pagelayer-img" src="'+url+'">';
|
462 |
|
463 |
if(is_link){
|
464 |
ul += '</a>';
|
127 |
videoId = src.split('.be/');
|
128 |
}
|
129 |
//console.log(frame_height);
|
130 |
+
el.atts['vid_src'] = '<iframe src="'+iframe_src+'&autoplay=1&controls=0&showinfo=0&rel=0&autohide=1&playlist='+videoId[1]+'" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
131 |
|
132 |
} else if (vimeoRegExp.exec(src)) {
|
133 |
|
134 |
+
el.atts['vid_src'] = '<iframe src="'+iframe_src+'&background=1&autoplay=1&byline=0&title=0" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
135 |
|
136 |
}else{
|
137 |
|
287 |
|
288 |
var dropDiv = '<div class="pagelayer-image-drop-zone">'+
|
289 |
'<div>'+
|
290 |
+
'<i class="fas fa-upload"></i>'+
|
291 |
'<h4>'+pagelayer_l('drop_file')+'</h4>'+
|
292 |
'<div class="pagelayer-img-up-progress">'+
|
293 |
'<div class="pagelayer-img-up-bar"></div>'+
|
435 |
// The URLs
|
436 |
var img_urls = !pagelayer_empty(el.tmp['ids-urls']) ? JSON.parse(el.tmp['ids-urls']) : [];
|
437 |
var all_urls = !pagelayer_empty(el.tmp['ids-all-urls']) ? JSON.parse(el.tmp['ids-all-urls']) : [];
|
438 |
+
var img_title = !pagelayer_empty(el.tmp['ids-all-titles']) ? JSON.parse(el.tmp['ids-all-titles']) : [];
|
439 |
//console.log(img_urls);
|
440 |
|
441 |
var ul = '';
|
459 |
ul += '<a href="'+link+'">';
|
460 |
}
|
461 |
|
462 |
+
ul += '<img class="pagelayer-img" src="'+url+'" title="'+img_title[x]+'" alt="'+img_title[x]+'">';
|
463 |
|
464 |
if(is_link){
|
465 |
ul += '</a>';
|
@@ -1832,5 +1832,7 @@
|
|
1832 |
"img_paste_conf" : "You have pasted over an existing image. How do you want to use the image ?",
|
1833 |
"custom_profile" : "Profile Name",
|
1834 |
"disable_sep" : "Disable Separator",
|
1835 |
-
"message_style" : "Message Box"
|
|
|
|
|
1836 |
}
|
1832 |
"img_paste_conf" : "You have pasted over an existing image. How do you want to use the image ?",
|
1833 |
"custom_profile" : "Profile Name",
|
1834 |
"disable_sep" : "Disable Separator",
|
1835 |
+
"message_style" : "Message Box",
|
1836 |
+
"clip_hide" : "Hide Clip",
|
1837 |
+
"show_mega_menu" : "Show Mega Menu"
|
1838 |
}
|
@@ -126,6 +126,19 @@ function pagelayer_wp_widget_ajax(){
|
|
126 |
$ret['widget_data'] = $instance;
|
127 |
}
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
pagelayer_json_output($ret);
|
130 |
|
131 |
}
|
@@ -163,6 +176,14 @@ function pagelayer_save_content(){
|
|
163 |
// Check if the post exists
|
164 |
if(!empty($postID) && !empty($content)){
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
$post = array(
|
167 |
'ID' => $postID,
|
168 |
'post_content' => $content,
|
@@ -210,11 +231,24 @@ function pagelayer_save_content(){
|
|
210 |
$post = apply_filters('pagelayer_save_content', $post);
|
211 |
|
212 |
// Update the post into the database
|
213 |
-
wp_update_post($post);
|
214 |
|
215 |
-
if (is_wp_error($
|
216 |
-
$
|
|
|
217 |
}else{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
$msg['success'] = __pl('post_update_success');
|
219 |
}
|
220 |
|
@@ -271,6 +305,9 @@ function pagelayer_save_templ_content($echo = false){
|
|
271 |
continue;
|
272 |
}
|
273 |
|
|
|
|
|
|
|
274 |
$is_xss = pagelayer_xss_content($value['content']);
|
275 |
|
276 |
if(!current_user_can('manage_options') && strlen($is_xss) > 0){
|
@@ -590,7 +627,10 @@ function pagelayer_create_post_autosave(){
|
|
590 |
$ret = array();
|
591 |
$postID = (int) $_GET['postID'];
|
592 |
$content = $_REQUEST['pagelayer_post_content'];
|
593 |
-
|
|
|
|
|
|
|
594 |
// Are you allowed to edit ?
|
595 |
if(!pagelayer_user_can_edit($postID)){
|
596 |
$ret['error'][] = __pl('no_permission');
|
@@ -1626,6 +1666,12 @@ function pagelayer_export_template(){
|
|
1626 |
}
|
1627 |
}
|
1628 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1629 |
// Write the content
|
1630 |
file_put_contents($theme_dir.'/'.$v->post_name.'.pgl', pagelayer_export_content($v->post_content));
|
1631 |
$conf[$v->post_name] = [
|
@@ -1666,11 +1712,30 @@ function pagelayer_export_template(){
|
|
1666 |
|
1667 |
// Write the files
|
1668 |
foreach($posts as $k => $v){
|
|
|
|
|
|
|
|
|
|
|
|
|
1669 |
|
1670 |
file_put_contents($theme_dir.'/data/'.$type.'/'.$v->post_name, pagelayer_export_content($v->post_content));
|
1671 |
unset($v->post_content);
|
1672 |
|
1673 |
$meta = get_post_meta($v->ID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1674 |
|
1675 |
// Also put the meta
|
1676 |
file_put_contents($theme_dir.'/data/'.$type.'/'.$v->post_name.'.meta', json_encode($meta, JSON_PRETTY_PRINT));
|
@@ -1685,8 +1750,46 @@ function pagelayer_export_template(){
|
|
1685 |
|
1686 |
}
|
1687 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1688 |
// Export the settings
|
1689 |
-
$settings = ['pagelayer_content_width', 'pagelayer_body_font', 'pagelayer_tablet_breakpoint', 'pagelayer_mobile_breakpoint', 'pagelayer_body_typography', 'pagelayer_h1_typography', 'pagelayer_h2_typography', 'pagelayer_h3_typography', 'pagelayer_h4_typography', 'pagelayer_h5_typography', 'pagelayer_h6_typography', 'pagelayer_color', 'pagelayer_header_code', 'pagelayer_footer_code', 'pagelayer_sidebar'];
|
1690 |
|
1691 |
foreach($settings as $v){
|
1692 |
|
126 |
$ret['widget_data'] = $instance;
|
127 |
}
|
128 |
|
129 |
+
// Custom html widget form elements
|
130 |
+
if(!empty($widget) && $widget->name=='Custom HTML'){
|
131 |
+
$custom_html = explode('>', $ret['form']);
|
132 |
+
|
133 |
+
$custom_html[0] = '<label for="widget-custom_html-pagelayer-widget-1234567890-title">Title:</label>'.$custom_html[0];
|
134 |
+
$custom_html[0] = str_replace('type="hidden"', 'type="text"',$custom_html[0]);
|
135 |
+
|
136 |
+
$custom_html[1] = '<label for="widget-custom_html-pagelayer-widget-1234567890-content">Content:</label>'.$custom_html[1];
|
137 |
+
$custom_html[1] = str_replace('hidden', '', $custom_html[1]);
|
138 |
+
|
139 |
+
$ret['form'] = implode('>', $custom_html);
|
140 |
+
}
|
141 |
+
|
142 |
pagelayer_json_output($ret);
|
143 |
|
144 |
}
|
176 |
// Check if the post exists
|
177 |
if(!empty($postID) && !empty($content)){
|
178 |
|
179 |
+
$content = base64_decode($content);
|
180 |
+
|
181 |
+
/*if(!pagelayer_is_utf8($content)){
|
182 |
+
$content = utf8_encode($content);
|
183 |
+
}*/
|
184 |
+
|
185 |
+
$content = wp_slash($content);
|
186 |
+
|
187 |
$post = array(
|
188 |
'ID' => $postID,
|
189 |
'post_content' => $content,
|
231 |
$post = apply_filters('pagelayer_save_content', $post);
|
232 |
|
233 |
// Update the post into the database
|
234 |
+
$ret = wp_update_post($post, true);
|
235 |
|
236 |
+
if (is_wp_error($ret)) {
|
237 |
+
$errors = $ret->get_error_messages();
|
238 |
+
$msg['error'] = __pl('post_update_err').' : '.implode('', $errors);
|
239 |
}else{
|
240 |
+
|
241 |
+
// Is this a Pagelayer post
|
242 |
+
$data = get_post_meta($postID, 'pagelayer-data', true);
|
243 |
+
|
244 |
+
if(empty($data)){
|
245 |
+
|
246 |
+
// Convert to pagelayer accessed post
|
247 |
+
if(!add_post_meta($postID, 'pagelayer-data', time(), true)){
|
248 |
+
update_post_meta($postID, 'pagelayer-data', time());
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
$msg['success'] = __pl('post_update_success');
|
253 |
}
|
254 |
|
305 |
continue;
|
306 |
}
|
307 |
|
308 |
+
// Decode base64 data
|
309 |
+
$value['content'] = base64_decode($value['content']);
|
310 |
+
|
311 |
$is_xss = pagelayer_xss_content($value['content']);
|
312 |
|
313 |
if(!current_user_can('manage_options') && strlen($is_xss) > 0){
|
627 |
$ret = array();
|
628 |
$postID = (int) $_GET['postID'];
|
629 |
$content = $_REQUEST['pagelayer_post_content'];
|
630 |
+
|
631 |
+
// Decode base64 data
|
632 |
+
$content = base64_decode($content);
|
633 |
+
|
634 |
// Are you allowed to edit ?
|
635 |
if(!pagelayer_user_can_edit($postID)){
|
636 |
$ret['error'][] = __pl('no_permission');
|
1666 |
}
|
1667 |
}
|
1668 |
|
1669 |
+
// Only blocks allowed
|
1670 |
+
if(!has_blocks($v->post_content)){
|
1671 |
+
$done['error'] = 'This pagelayer template '.$v->ID.' has Shortcodes which is not allowed for export !';
|
1672 |
+
pagelayer_json_output($done);
|
1673 |
+
}
|
1674 |
+
|
1675 |
// Write the content
|
1676 |
file_put_contents($theme_dir.'/'.$v->post_name.'.pgl', pagelayer_export_content($v->post_content));
|
1677 |
$conf[$v->post_name] = [
|
1712 |
|
1713 |
// Write the files
|
1714 |
foreach($posts as $k => $v){
|
1715 |
+
|
1716 |
+
// Only blocks allowed
|
1717 |
+
if(!has_blocks($v->post_content)){
|
1718 |
+
$done['error'] = 'The post '.$v->ID.' has Shortcodes which is not allowed for export !';
|
1719 |
+
pagelayer_json_output($done);
|
1720 |
+
}
|
1721 |
|
1722 |
file_put_contents($theme_dir.'/data/'.$type.'/'.$v->post_name, pagelayer_export_content($v->post_content));
|
1723 |
unset($v->post_content);
|
1724 |
|
1725 |
$meta = get_post_meta($v->ID);
|
1726 |
+
$meta = array_combine(array_keys($meta), array_column($meta, 0));
|
1727 |
+
|
1728 |
+
// Export media
|
1729 |
+
if(!empty($meta['_thumbnail_id'])){
|
1730 |
+
|
1731 |
+
$file = pagelayer_export_media_files($meta['_thumbnail_id'], $exp_img_url);
|
1732 |
+
|
1733 |
+
// Did it export ?
|
1734 |
+
if(!empty($file)){
|
1735 |
+
$meta['_thumbnail_id'] = $exp_img_url;
|
1736 |
+
}
|
1737 |
+
|
1738 |
+
}
|
1739 |
|
1740 |
// Also put the meta
|
1741 |
file_put_contents($theme_dir.'/data/'.$type.'/'.$v->post_name.'.meta', json_encode($meta, JSON_PRETTY_PRINT));
|
1750 |
|
1751 |
}
|
1752 |
|
1753 |
+
// Export menus
|
1754 |
+
if(!empty($pagelayer->export_menus) && is_array($pagelayer->export_menus)){
|
1755 |
+
|
1756 |
+
mkdir($theme_dir.'/data/menus');
|
1757 |
+
|
1758 |
+
foreach($pagelayer->export_menus as $k => $v){
|
1759 |
+
|
1760 |
+
$menu = (int) $k;
|
1761 |
+
$menu = wp_get_nav_menu_object( $menu );
|
1762 |
+
|
1763 |
+
if(empty($menu)){
|
1764 |
+
$done['error'] = 'Could not export menu ID - '.$k;
|
1765 |
+
continue;
|
1766 |
+
}
|
1767 |
+
|
1768 |
+
// Menu Items
|
1769 |
+
$menu_items = wp_get_nav_menu_items( $menu->term_id );
|
1770 |
+
$data = [];
|
1771 |
+
|
1772 |
+
if(is_array($menu_items) && !empty($menu_items)){
|
1773 |
+
foreach($menu_items as $kk => $singlenav){
|
1774 |
+
$navmetas = get_post_meta($singlenav->ID);
|
1775 |
+
$data[$kk]['post'] = $singlenav;
|
1776 |
+
$data[$kk]['post_metas'] = $navmetas;
|
1777 |
+
}
|
1778 |
+
}
|
1779 |
+
|
1780 |
+
// Also put the meta
|
1781 |
+
file_put_contents($theme_dir.'/data/menus/'.$menu->slug, json_encode($data, JSON_PRETTY_PRINT));
|
1782 |
+
|
1783 |
+
$conf['menus'][$menu->slug] = $menu;
|
1784 |
+
|
1785 |
+
do_action('pagelayer_menus_exported', $v, $theme_dir);
|
1786 |
+
|
1787 |
+
}
|
1788 |
+
|
1789 |
+
}
|
1790 |
+
|
1791 |
// Export the settings
|
1792 |
+
$settings = ['pagelayer_content_width', 'pagelayer_body_font', 'pagelayer_tablet_breakpoint', 'pagelayer_mobile_breakpoint', 'pagelayer_body_typography', 'pagelayer_h1_typography', 'pagelayer_h2_typography', 'pagelayer_h3_typography', 'pagelayer_h4_typography', 'pagelayer_h5_typography', 'pagelayer_h6_typography', 'pagelayer_color', 'pagelayer_header_code', 'pagelayer_footer_code', 'pagelayer_sidebar', 'page_for_posts'];
|
1793 |
|
1794 |
foreach($settings as $v){
|
1795 |
|
@@ -410,12 +410,13 @@ function pagelayer_livelink($id){
|
|
410 |
}
|
411 |
|
412 |
// Are we in live mode ?
|
413 |
-
function pagelayer_is_live(){
|
414 |
|
415 |
global $post;
|
416 |
|
417 |
// Are we seeing the post ?
|
418 |
if(!isset($post) || !isset($post->ID) || empty($post->ID)){
|
|
|
419 |
return false;
|
420 |
}
|
421 |
|
@@ -428,11 +429,13 @@ function pagelayer_is_live(){
|
|
428 |
|
429 |
// Are you allowed to edit ?
|
430 |
if(!pagelayer_user_can_edit($parID)){
|
|
|
431 |
return false;
|
432 |
}
|
433 |
|
434 |
// Is it the live mode ?
|
435 |
if(pagelayer_optreq('pagelayer-live')){
|
|
|
436 |
return true;
|
437 |
}
|
438 |
|
@@ -441,10 +444,10 @@ function pagelayer_is_live(){
|
|
441 |
}
|
442 |
|
443 |
// Are we in live IFRAME mode ?
|
444 |
-
function pagelayer_is_live_iframe(){
|
445 |
|
446 |
// Are we seeing the post ?
|
447 |
-
if(!pagelayer_is_live()){
|
448 |
return false;
|
449 |
}
|
450 |
|
@@ -452,6 +455,8 @@ function pagelayer_is_live_iframe(){
|
|
452 |
if(pagelayer_optreq('pagelayer-iframe')){
|
453 |
return true;
|
454 |
}
|
|
|
|
|
455 |
|
456 |
return false;
|
457 |
|
@@ -1932,33 +1937,16 @@ function pagelayer_shortcode_current_query($query_args, $atts, $type){
|
|
1932 |
return $query_args;
|
1933 |
}
|
1934 |
|
1935 |
-
|
1936 |
-
|
1937 |
-
// Just call do_shortcode so we can get list of media files to export
|
1938 |
-
//do_shortcode($content);
|
1939 |
-
|
1940 |
-
$theme_url = preg_replace('/http(s?):\/\//is', '', get_stylesheet_directory_uri());
|
1941 |
-
|
1942 |
-
$content = preg_replace('/http(s?):\/\/'.preg_quote($theme_url, '/').'/is', '{{theme_url}}', $content);
|
1943 |
-
$content = str_replace('<!-- wp:pagelayer', '<!-- sp:pagelayer', $content);
|
1944 |
-
$content = str_replace('<!-- /wp:pagelayer', '<!-- /sp:pagelayer', $content);
|
1945 |
-
|
1946 |
-
// Export the media as well
|
1947 |
-
$content = pagelayer_export_media($content);
|
1948 |
-
|
1949 |
-
// Apply a filter
|
1950 |
-
$content = apply_filters('pagelayer_export_content', $content);
|
1951 |
-
|
1952 |
-
return $content;
|
1953 |
-
|
1954 |
-
}
|
1955 |
-
|
1956 |
-
function pagelayer_export_media($content){
|
1957 |
|
1958 |
global $pagelayer;
|
1959 |
|
1960 |
-
$
|
1961 |
-
|
|
|
|
|
|
|
1962 |
|
1963 |
// Loop thru all shortcodes
|
1964 |
foreach($pagelayer->shortcodes as $tag => $vvv){
|
@@ -1984,49 +1972,280 @@ function pagelayer_export_media($content){
|
|
1984 |
foreach($props as $prop => $param){
|
1985 |
|
1986 |
// Load any attachment values
|
1987 |
-
if(!in_array($param['type'],
|
1988 |
-
continue;
|
1989 |
-
}
|
1990 |
-
|
1991 |
-
$pattern = '/\['.$tag.'([^\]]*)'.$prop.'="(\d*)"([^\]]*)\]/is';
|
1992 |
-
|
1993 |
-
// Is there a match ?
|
1994 |
-
if(!preg_match($pattern, $content, $matches)){
|
1995 |
-
continue;
|
1996 |
-
}
|
1997 |
-
|
1998 |
-
//pagelayer_print($matches);die();
|
1999 |
-
|
2000 |
-
// Get the file path
|
2001 |
-
$file = get_attached_file($matches[2]);
|
2002 |
-
|
2003 |
-
if(empty($file) || !file_exists($file)){
|
2004 |
continue;
|
2005 |
}
|
2006 |
|
2007 |
-
|
2008 |
-
$content = str_replace($matches[0], '['.$tag.$matches[1].$prop.'="{{theme_url}}/images/'.basename($file).'"'.$matches[3].']', $content);
|
2009 |
-
|
2010 |
-
//echo $content;
|
2011 |
-
|
2012 |
-
// Copy the file
|
2013 |
-
copy($file, $image_dir.basename($file));
|
2014 |
-
|
2015 |
-
//pagelayer_print($file);
|
2016 |
-
//die();
|
2017 |
-
|
2018 |
-
}
|
2019 |
|
|
|
|
|
2020 |
}
|
|
|
|
|
2021 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022 |
}
|
|
|
2023 |
|
2024 |
}
|
2025 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026 |
return $content;
|
2027 |
|
2028 |
}
|
2029 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2030 |
// Insert a post which is a Pagelayer Post
|
2031 |
function pagelayer_insert_content($post, &$ret){
|
2032 |
|
@@ -2256,6 +2475,10 @@ function pagelayer_get_option($opt){
|
|
2256 |
// Uploads an image / media
|
2257 |
function pagelayer_upload_media($filename, $blob){
|
2258 |
|
|
|
|
|
|
|
|
|
2259 |
$md5 = md5($blob);
|
2260 |
|
2261 |
// Do we have this image
|
@@ -2554,4 +2777,8 @@ function pagelayer_enable_giver(){
|
|
2554 |
|
2555 |
function pagelayer_load_font_options(){
|
2556 |
include_once(PAGELAYER_DIR.'/main/font-options.php');
|
|
|
|
|
|
|
|
|
2557 |
}
|
410 |
}
|
411 |
|
412 |
// Are we in live mode ?
|
413 |
+
function pagelayer_is_live(&$error = array()){
|
414 |
|
415 |
global $post;
|
416 |
|
417 |
// Are we seeing the post ?
|
418 |
if(!isset($post) || !isset($post->ID) || empty($post->ID)){
|
419 |
+
$error[] = 'Post ID is missing or blank - '.@$post->ID;
|
420 |
return false;
|
421 |
}
|
422 |
|
429 |
|
430 |
// Are you allowed to edit ?
|
431 |
if(!pagelayer_user_can_edit($parID)){
|
432 |
+
$error[] = 'You dont have editing rights for this page - '.$parID;
|
433 |
return false;
|
434 |
}
|
435 |
|
436 |
// Is it the live mode ?
|
437 |
if(pagelayer_optreq('pagelayer-live')){
|
438 |
+
$error[] = 'pagelayer-live is missing';
|
439 |
return true;
|
440 |
}
|
441 |
|
444 |
}
|
445 |
|
446 |
// Are we in live IFRAME mode ?
|
447 |
+
function pagelayer_is_live_iframe(&$error = array()){
|
448 |
|
449 |
// Are we seeing the post ?
|
450 |
+
if(!pagelayer_is_live($error)){
|
451 |
return false;
|
452 |
}
|
453 |
|
455 |
if(pagelayer_optreq('pagelayer-iframe')){
|
456 |
return true;
|
457 |
}
|
458 |
+
|
459 |
+
$error[] = 'pagelayer-iframe missing in GET';
|
460 |
|
461 |
return false;
|
462 |
|
1937 |
return $query_args;
|
1938 |
}
|
1939 |
|
1940 |
+
// Loads the tags which have parameters of a particular type
|
1941 |
+
function pagelayer_get_prop_type($types){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1942 |
|
1943 |
global $pagelayer;
|
1944 |
|
1945 |
+
if(!is_array($types)){
|
1946 |
+
$types = [$types];
|
1947 |
+
}
|
1948 |
+
|
1949 |
+
$ret = [];
|
1950 |
|
1951 |
// Loop thru all shortcodes
|
1952 |
foreach($pagelayer->shortcodes as $tag => $vvv){
|
1972 |
foreach($props as $prop => $param){
|
1973 |
|
1974 |
// Load any attachment values
|
1975 |
+
if(!in_array($param['type'], $types)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1976 |
continue;
|
1977 |
}
|
1978 |
|
1979 |
+
$ret[$tag][$prop] = $param['type'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1980 |
|
1981 |
+
}
|
1982 |
+
|
1983 |
}
|
1984 |
+
|
1985 |
+
}
|
1986 |
|
1987 |
+
}
|
1988 |
+
|
1989 |
+
//r_print($ret);die();
|
1990 |
+
|
1991 |
+
return $ret;
|
1992 |
+
|
1993 |
+
}
|
1994 |
+
|
1995 |
+
function pagelayer_export_content($content){
|
1996 |
+
|
1997 |
+
global $pagelayer;
|
1998 |
+
|
1999 |
+
// Just call do_shortcode so we can get list of media files to export
|
2000 |
+
//do_shortcode($content);
|
2001 |
+
|
2002 |
+
$theme_url = preg_replace('/http(s?):\/\//is', '', get_stylesheet_directory_uri());
|
2003 |
+
|
2004 |
+
$content = preg_replace('/http(s?):\/\/'.preg_quote($theme_url, '/').'/is', '{{theme_url}}', $content);
|
2005 |
+
$content = str_replace('<!-- wp:pagelayer', '<!-- sp:pagelayer', $content);
|
2006 |
+
$content = str_replace('<!-- /wp:pagelayer', '<!-- /sp:pagelayer', $content);
|
2007 |
+
|
2008 |
+
// Remove unnecessary spaces
|
2009 |
+
$content = preg_replace('/--\>\s*(?!<!--)/is', '-->', $content);
|
2010 |
+
|
2011 |
+
// Replace links of the theme for images
|
2012 |
+
$content = pagelayer_export_theme_links($content, get_stylesheet_directory_uri());
|
2013 |
+
|
2014 |
+
////////////////////
|
2015 |
+
// Handle Link IDs
|
2016 |
+
////////////////////
|
2017 |
+
|
2018 |
+
if(empty($pagelayer->e['link_tags'])){
|
2019 |
+
$pagelayer->e['link_tags'] = pagelayer_get_prop_type('link');
|
2020 |
+
//r_print($pagelayer->e['link_tags']);die();
|
2021 |
+
}
|
2022 |
+
|
2023 |
+
if(empty($pagelayer->e['media_tags'])){
|
2024 |
+
$pagelayer->e['media_tags'] = pagelayer_get_prop_type(['image', 'video', 'audio', 'media', 'multi_image']);
|
2025 |
+
//r_print($pagelayer->e['media_tags']);die();
|
2026 |
+
}
|
2027 |
+
|
2028 |
+
$parsed = parse_blocks($content);
|
2029 |
+
//r_print($parsed);//die();
|
2030 |
+
|
2031 |
+
$parsed = pagelayer_export_link_ids($parsed);
|
2032 |
+
|
2033 |
+
// Export the media as well
|
2034 |
+
$parsed = pagelayer_export_media($parsed);
|
2035 |
+
|
2036 |
+
// Reserialize
|
2037 |
+
$content = serialize_blocks($parsed);
|
2038 |
+
|
2039 |
+
// Just pass the content to
|
2040 |
+
$content = pagelayer_export_extract_menu_ids($content);
|
2041 |
+
|
2042 |
+
// Apply a filter
|
2043 |
+
$content = apply_filters('pagelayer_export_content', $content);
|
2044 |
+
|
2045 |
+
return $content;
|
2046 |
+
|
2047 |
+
}
|
2048 |
+
|
2049 |
+
// Export the menu IDs
|
2050 |
+
function pagelayer_export_extract_menu_ids($content){
|
2051 |
+
|
2052 |
+
global $pagelayer;
|
2053 |
+
|
2054 |
+
// Any Menu ?
|
2055 |
+
preg_match_all('/\[pl_wp_menu ([^\]]*)nav_list="(\d*)"([^\]]*)\]/is', $content, $matches);
|
2056 |
+
//r_print($matches);
|
2057 |
+
|
2058 |
+
if(!empty($matches[2])){
|
2059 |
+
|
2060 |
+
foreach($matches[2] as $k => $v){
|
2061 |
+
$v = (int)$v;
|
2062 |
+
$pagelayer->export_menus[$v] = $v;
|
2063 |
}
|
2064 |
+
//r_print($pagelayer->export_menus);
|
2065 |
|
2066 |
}
|
2067 |
|
2068 |
+
// Also for block format
|
2069 |
+
preg_match_all('/<!--\s+(?P<closer>\/)?sp:pagelayer\/pl_wp_menu\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?P<void>\/)?-->/s', $content, $matches);
|
2070 |
+
|
2071 |
+
if(!empty($matches['attrs'])){
|
2072 |
+
|
2073 |
+
foreach($matches['attrs'] as $k => $v){
|
2074 |
+
preg_match('/nav_list"\s*:\s*"(\d*)"/is', $v, $vmatch);
|
2075 |
+
|
2076 |
+
if(!empty($vmatch[1])){
|
2077 |
+
$vmatch[1] = (int)$vmatch[1];
|
2078 |
+
$pagelayer->export_menus[$vmatch[1]] = $vmatch[1];
|
2079 |
+
//r_print($pagelayer->export_menus);
|
2080 |
+
}
|
2081 |
+
}
|
2082 |
+
}
|
2083 |
+
|
2084 |
return $content;
|
2085 |
|
2086 |
}
|
2087 |
|
2088 |
+
function pagelayer_export_link_ids($parsed){
|
2089 |
+
|
2090 |
+
global $pagelayer;
|
2091 |
+
|
2092 |
+
foreach($parsed as $k => $v){
|
2093 |
+
|
2094 |
+
if(!empty($v['innerBlocks'])){
|
2095 |
+
$parsed[$k]['innerBlocks'] = pagelayer_export_link_ids($v['innerBlocks']);
|
2096 |
+
}
|
2097 |
+
|
2098 |
+
if(!preg_match('/pagelayer/is', $v['blockName'])){
|
2099 |
+
continue;
|
2100 |
+
}
|
2101 |
+
|
2102 |
+
$tag = str_replace('pagelayer/', '', $v['blockName']);
|
2103 |
+
//echo $tag;//die();
|
2104 |
+
|
2105 |
+
// Is there a tag having a link prop
|
2106 |
+
if(empty($pagelayer->e['link_tags'][$tag])){
|
2107 |
+
continue;
|
2108 |
+
}
|
2109 |
+
//echo $tag;die();
|
2110 |
+
|
2111 |
+
foreach($pagelayer->e['link_tags'][$tag] as $kk => $vv){
|
2112 |
+
if(!empty($v['attrs'][$kk]) && is_numeric($v['attrs'][$kk])){
|
2113 |
+
$linked = get_post($v['attrs'][$kk]);
|
2114 |
+
if(!empty($linked->post_name)){
|
2115 |
+
$parsed[$k]['attrs'][$kk] = '||link_id|'.$linked->post_type.'|'.$linked->post_name.'||';
|
2116 |
+
}
|
2117 |
+
//echo $tag;echo '-'.$kk;r_print($parsed[$k]['attrs']);die();
|
2118 |
+
}
|
2119 |
+
}
|
2120 |
+
|
2121 |
+
}
|
2122 |
+
|
2123 |
+
return $parsed;
|
2124 |
+
|
2125 |
+
}
|
2126 |
+
|
2127 |
+
// Replace theme links with theme_url
|
2128 |
+
function pagelayer_export_theme_links($content, $link){
|
2129 |
+
|
2130 |
+
global $sitepad;
|
2131 |
+
|
2132 |
+
// Theme URL correction code
|
2133 |
+
$theme_url = preg_replace('/http(s?):\/\//is', '', $link);
|
2134 |
+
|
2135 |
+
$theme_urls[0] = 'http://'.$theme_url;
|
2136 |
+
$theme_urls[1] = 'https://'.$theme_url;
|
2137 |
+
$theme_urls[2] = $theme_url;
|
2138 |
+
$theme_urls[3] = str_replace('/', '\\/', $theme_urls[0]);
|
2139 |
+
$theme_urls[4] = str_replace('/', '\\/', $theme_urls[1]);
|
2140 |
+
$theme_urls[5] = str_replace('/', '\\/', $theme_url);
|
2141 |
+
|
2142 |
+
foreach($theme_urls as $k => $v){
|
2143 |
+
$content = preg_replace_callback('/'.preg_quote($v, '/').'([^"]*)/is', 'pagelayer_export_theme_links_replacer', $content);
|
2144 |
+
}
|
2145 |
+
|
2146 |
+
$content = str_ireplace($theme_urls, '{{theme_url}}', $content);
|
2147 |
+
|
2148 |
+
return $content;
|
2149 |
+
}
|
2150 |
+
|
2151 |
+
// This function is a part of pagelayer_export_theme_links
|
2152 |
+
function pagelayer_export_theme_links_replacer($matches){
|
2153 |
+
return '{{theme_url}}'.str_replace('\\/', '/', $matches[1]);
|
2154 |
+
}
|
2155 |
+
|
2156 |
+
// Export media
|
2157 |
+
function pagelayer_export_media($parsed){
|
2158 |
+
|
2159 |
+
global $pagelayer;
|
2160 |
+
|
2161 |
+
foreach($parsed as $k => $v){
|
2162 |
+
|
2163 |
+
if(!empty($v['innerBlocks'])){
|
2164 |
+
$parsed[$k]['innerBlocks'] = pagelayer_export_media($v['innerBlocks']);
|
2165 |
+
}
|
2166 |
+
|
2167 |
+
if(!preg_match('/pagelayer/is', $v['blockName'])){
|
2168 |
+
continue;
|
2169 |
+
}
|
2170 |
+
|
2171 |
+
$tag = str_replace('pagelayer/', '', $v['blockName']);
|
2172 |
+
//echo $tag;//die();
|
2173 |
+
|
2174 |
+
// Is there a tag having a link prop
|
2175 |
+
if(empty($pagelayer->e['media_tags'][$tag])){
|
2176 |
+
continue;
|
2177 |
+
}
|
2178 |
+
//echo $tag;die();
|
2179 |
+
|
2180 |
+
foreach($pagelayer->e['media_tags'][$tag] as $kk => $vv){
|
2181 |
+
|
2182 |
+
if(empty($v['attrs'][$kk])){
|
2183 |
+
continue;
|
2184 |
+
}
|
2185 |
+
|
2186 |
+
// Is it our default image ?
|
2187 |
+
if(preg_match('/pagelayer-pro\/images\/default-image.png$/is', $v['attrs'][$kk])){
|
2188 |
+
$parsed[$k]['attrs'][$kk] = '';
|
2189 |
+
continue;
|
2190 |
+
}
|
2191 |
+
|
2192 |
+
if(!is_numeric($v['attrs'][$kk]) && !preg_match('/^((\d*)(,?))*$/is', $v['attrs'][$kk])){
|
2193 |
+
continue;
|
2194 |
+
}
|
2195 |
+
|
2196 |
+
$ids = explode(',', $v['attrs'][$kk]);
|
2197 |
+
$ret = [];
|
2198 |
+
|
2199 |
+
foreach($ids as $id){
|
2200 |
+
|
2201 |
+
$file = pagelayer_export_media_files($id, $exp_img_url);
|
2202 |
+
|
2203 |
+
// Did it export ?
|
2204 |
+
if(empty($file) || !file_exists($file)){
|
2205 |
+
continue;
|
2206 |
+
}
|
2207 |
+
|
2208 |
+
$ret[] = $exp_img_url;
|
2209 |
+
|
2210 |
+
}
|
2211 |
+
|
2212 |
+
$parsed[$k]['attrs'][$kk] = implode(',', $ret);
|
2213 |
+
//echo $tag;echo '-'.$kk;r_print($parsed[$k]['attrs']);die();
|
2214 |
+
}
|
2215 |
+
|
2216 |
+
}
|
2217 |
+
|
2218 |
+
return $parsed;
|
2219 |
+
|
2220 |
+
}
|
2221 |
+
|
2222 |
+
// Exports the media to the images folder of the current theme
|
2223 |
+
function pagelayer_export_media_files($id, &$url = ''){
|
2224 |
+
|
2225 |
+
$theme_dir = get_stylesheet_directory();
|
2226 |
+
$image_dir = $theme_dir.'/images/';
|
2227 |
+
@mkdir($image_dir);
|
2228 |
+
|
2229 |
+
// Get the file path
|
2230 |
+
$file = get_attached_file($id);
|
2231 |
+
|
2232 |
+
if(empty($file) || !file_exists($file)){
|
2233 |
+
return false;
|
2234 |
+
}
|
2235 |
+
|
2236 |
+
$dest_file = $image_dir.basename($file);
|
2237 |
+
|
2238 |
+
// Copy the file
|
2239 |
+
copy($file, $dest_file);
|
2240 |
+
|
2241 |
+
// Replace the text
|
2242 |
+
$url = '{{theme_url}}/images/'.basename($file);
|
2243 |
+
|
2244 |
+
return $dest_file;
|
2245 |
+
|
2246 |
+
//echo $content;
|
2247 |
+
}
|
2248 |
+
|
2249 |
// Insert a post which is a Pagelayer Post
|
2250 |
function pagelayer_insert_content($post, &$ret){
|
2251 |
|
2475 |
// Uploads an image / media
|
2476 |
function pagelayer_upload_media($filename, $blob){
|
2477 |
|
2478 |
+
if(empty($blob)){
|
2479 |
+
return false;
|
2480 |
+
}
|
2481 |
+
|
2482 |
$md5 = md5($blob);
|
2483 |
|
2484 |
// Do we have this image
|
2777 |
|
2778 |
function pagelayer_load_font_options(){
|
2779 |
include_once(PAGELAYER_DIR.'/main/font-options.php');
|
2780 |
+
}
|
2781 |
+
|
2782 |
+
function pagelayer_is_utf8($str) {
|
2783 |
+
return (bool) preg_match('//u', $str);
|
2784 |
}
|
@@ -58,7 +58,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
58 |
<?php $style = (defined('SITEPAD')) ? 'style="width:30%; height: 265px"' : ''; ?>
|
59 |
<div class="feature-block-card" <?php echo $style; ?>>
|
60 |
<div class="feature-block">
|
61 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fas fa-mouse-pointer" aria-hidden="true">' : '<i class="fas fa-paper-plane" aria-hidden="true"
|
62 |
</div>
|
63 |
<div class="feature-block-content">
|
64 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('dragdrop') : __pl('oneclick')?></h5>
|
@@ -67,7 +67,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
67 |
</div>
|
68 |
<div class="feature-block-card" <?php echo $style; ?>>
|
69 |
<div class="feature-block">
|
70 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-th-list" aria-hidden="true">' : '<i class="fas fa-random" aria-hidden="true"
|
71 |
</div>
|
72 |
<div class="feature-block-content">
|
73 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('widgets') : __pl('static_pages')?></h5>
|
@@ -76,7 +76,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
76 |
</div>
|
77 |
<div class="feature-block-card" <?php echo $style; ?>>
|
78 |
<div class="feature-block">
|
79 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-pencil" aria-hidden="true">' : '<i class="fas fa-mobile-alt" aria-hidden="true"
|
80 |
</div>
|
81 |
<div class="feature-block-content">
|
82 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('inline_edit') : __pl('responsive_styles')?></h5>
|
@@ -85,7 +85,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
85 |
</div>
|
86 |
<div class="feature-block-card" <?php echo $style; ?>>
|
87 |
<div class="feature-block">
|
88 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-clone" aria-hidden="true">' : '<i class="fas fa-share-square" aria-hidden="true"
|
89 |
</div>
|
90 |
<div class="feature-block-content">
|
91 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('duplicate') : __pl('social_media')?></h5>
|
@@ -94,7 +94,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
94 |
</div>
|
95 |
<div class="feature-block-card" <?php echo $style; ?>>
|
96 |
<div class="feature-block">
|
97 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-snowflake-o fa-spin" aria-hidden="true">' : '<i class="fas fa-check" aria-hidden="true"
|
98 |
</div>
|
99 |
<div class="feature-block-content">
|
100 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('animation') : __pl('easy_use')?></h5>
|
@@ -103,7 +103,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
103 |
</div>
|
104 |
<div class="feature-block-card" <?php echo $style; ?>>
|
105 |
<div class="feature-block">
|
106 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-text-width" aria-hidden="true">' : '<i class="fas fa-cog" aria-hidden="true"
|
107 |
</div>
|
108 |
<div class="feature-block-content">
|
109 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('style_option') : __pl('cpanel_integrate')?></h5>
|
@@ -112,7 +112,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
112 |
</div>
|
113 |
<div class="feature-block-card" <?php echo $style; ?>>
|
114 |
<div class="feature-block">
|
115 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-paint-brush" aria-hidden="true">' : '<i class="fas fa-th-large" aria-hidden="true"
|
116 |
</div>
|
117 |
<div class="feature-block-content">
|
118 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('real_design') : __pl('multisites')?></h5>
|
@@ -121,7 +121,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
121 |
</div>
|
122 |
<div class="feature-block-card" <?php echo $style; ?>>
|
123 |
<div class="feature-block">
|
124 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-font" aria-hidden="true">' : '<i class="fas fa-copy" aria-hidden="true"
|
125 |
</div>
|
126 |
<div class="feature-block-content">
|
127 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('typography') : __pl('replicate_obj')?></h5>
|
@@ -130,7 +130,7 @@ $app = (!defined('SITEPAD') ? 'Pagelayer' : BRAND_SM);
|
|
130 |
</div>
|
131 |
<div class="feature-block-card" <?php echo $style; ?>>
|
132 |
<div class="feature-block">
|
133 |
-
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-cubes" aria-hidden="true">' : '<i class="fas fa-shopping-cart" aria-hidden="true"
|
134 |
</div>
|
135 |
<div class="feature-block-content">
|
136 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('easy_customize') : __pl('whmcs')?></h5>
|
58 |
<?php $style = (defined('SITEPAD')) ? 'style="width:30%; height: 265px"' : ''; ?>
|
59 |
<div class="feature-block-card" <?php echo $style; ?>>
|
60 |
<div class="feature-block">
|
61 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fas fa-mouse-pointer" aria-hidden="true">' : '<i class="fas fa-paper-plane" aria-hidden="true">' ?></i>
|
62 |
</div>
|
63 |
<div class="feature-block-content">
|
64 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('dragdrop') : __pl('oneclick')?></h5>
|
67 |
</div>
|
68 |
<div class="feature-block-card" <?php echo $style; ?>>
|
69 |
<div class="feature-block">
|
70 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-th-list" aria-hidden="true">' : '<i class="fas fa-random" aria-hidden="true">' ?></i>
|
71 |
</div>
|
72 |
<div class="feature-block-content">
|
73 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('widgets') : __pl('static_pages')?></h5>
|
76 |
</div>
|
77 |
<div class="feature-block-card" <?php echo $style; ?>>
|
78 |
<div class="feature-block">
|
79 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-pencil" aria-hidden="true">' : '<i class="fas fa-mobile-alt" aria-hidden="true">' ?></i>
|
80 |
</div>
|
81 |
<div class="feature-block-content">
|
82 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('inline_edit') : __pl('responsive_styles')?></h5>
|
85 |
</div>
|
86 |
<div class="feature-block-card" <?php echo $style; ?>>
|
87 |
<div class="feature-block">
|
88 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-clone" aria-hidden="true">' : '<i class="fas fa-share-square" aria-hidden="true">' ?></i>
|
89 |
</div>
|
90 |
<div class="feature-block-content">
|
91 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('duplicate') : __pl('social_media')?></h5>
|
94 |
</div>
|
95 |
<div class="feature-block-card" <?php echo $style; ?>>
|
96 |
<div class="feature-block">
|
97 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-snowflake-o fa-spin" aria-hidden="true">' : '<i class="fas fa-check" aria-hidden="true">' ?></i>
|
98 |
</div>
|
99 |
<div class="feature-block-content">
|
100 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('animation') : __pl('easy_use')?></h5>
|
103 |
</div>
|
104 |
<div class="feature-block-card" <?php echo $style; ?>>
|
105 |
<div class="feature-block">
|
106 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-text-width" aria-hidden="true">' : '<i class="fas fa-cog" aria-hidden="true">' ?></i>
|
107 |
</div>
|
108 |
<div class="feature-block-content">
|
109 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('style_option') : __pl('cpanel_integrate')?></h5>
|
112 |
</div>
|
113 |
<div class="feature-block-card" <?php echo $style; ?>>
|
114 |
<div class="feature-block">
|
115 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-paint-brush" aria-hidden="true">' : '<i class="fas fa-th-large" aria-hidden="true">' ?></i>
|
116 |
</div>
|
117 |
<div class="feature-block-content">
|
118 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('real_design') : __pl('multisites')?></h5>
|
121 |
</div>
|
122 |
<div class="feature-block-card" <?php echo $style; ?>>
|
123 |
<div class="feature-block">
|
124 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-font" aria-hidden="true">' : '<i class="fas fa-copy" aria-hidden="true">' ?></i>
|
125 |
</div>
|
126 |
<div class="feature-block-content">
|
127 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('typography') : __pl('replicate_obj')?></h5>
|
130 |
</div>
|
131 |
<div class="feature-block-card" <?php echo $style; ?>>
|
132 |
<div class="feature-block">
|
133 |
+
<?php echo (!defined('SITEPAD')) ? '<i class="fa fa-cubes" aria-hidden="true">' : '<i class="fas fa-shopping-cart" aria-hidden="true">' ?></i>
|
134 |
</div>
|
135 |
<div class="feature-block-content">
|
136 |
<h5><?php echo (!defined('SITEPAD')) ? __pl('easy_customize') : __pl('whmcs')?></h5>
|
@@ -49,6 +49,8 @@ function pagelayer_import(){
|
|
49 |
$GLOBALS['pl_warn'] = __('You have already imported the content of this theme. You can re-import the same by either choosing to over-write existing pages / pagelayer templates OR creating duplicate content !', 'pagelayer');
|
50 |
}
|
51 |
|
|
|
|
|
52 |
// Call the theme
|
53 |
pagelayer_import_T();
|
54 |
|
@@ -297,6 +299,20 @@ pagelayer_page_footer(1);
|
|
297 |
|
298 |
}
|
299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
// The actual function to import the theme
|
301 |
function pagelayer_import_single($template_name, $items, $pagelayer_theme_path = ''){
|
302 |
|
@@ -392,15 +408,20 @@ global $pagelayer, $pl_error;
|
|
392 |
|
393 |
}
|
394 |
|
|
|
|
|
|
|
|
|
|
|
395 |
return true;
|
396 |
|
397 |
}
|
398 |
|
399 |
// The actual function to import the theme
|
400 |
function pagelayer_import_theme($template_name, $pagelayer_theme_path = ''){
|
401 |
-
|
402 |
-
global $wpdb, $wp_rewrite;
|
403 |
-
global $pagelayer, $pl_error;
|
404 |
|
405 |
if(empty($pagelayer_theme_path)){
|
406 |
$pagelayer_theme_path = get_stylesheet_directory();
|
@@ -426,6 +447,8 @@ global $pagelayer, $pl_error;
|
|
426 |
}
|
427 |
}
|
428 |
|
|
|
|
|
429 |
/////////////////////////
|
430 |
// Handle PAGELAYER DATA
|
431 |
/////////////////////////
|
@@ -439,6 +462,16 @@ global $pagelayer, $pl_error;
|
|
439 |
return false;
|
440 |
}
|
441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
// Check the theme files
|
443 |
foreach($pgl as $k => $v){
|
444 |
|
@@ -446,16 +479,60 @@ global $pagelayer, $pl_error;
|
|
446 |
//print_r($path);
|
447 |
|
448 |
// Does the page exist ?
|
449 |
-
if(!file_exists($path) || pagelayer_cleanpath(realpath($path)) != $path){
|
450 |
-
$pl_error[] = 'Something is fishy with this theme as the template '.$k.' of type '.$v['type'].' was not found';
|
451 |
return false;
|
452 |
}
|
453 |
|
454 |
}
|
455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
// Create the menu
|
457 |
if(empty($_POST['no_header_menu'])){
|
458 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
}else{
|
460 |
|
461 |
// Get the first menu that has items if we still can't find a menu.
|
@@ -470,7 +547,26 @@ global $pagelayer, $pl_error;
|
|
470 |
|
471 |
}
|
472 |
|
473 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
foreach($pgl as $k => $v){
|
475 |
|
476 |
$path = pagelayer_cleanpath($pagelayer_theme_path.'/'.$k.'.pgl');
|
@@ -495,7 +591,7 @@ global $pagelayer, $pl_error;
|
|
495 |
}
|
496 |
|
497 |
// Make an array
|
498 |
-
$new_post['post_content'] = file_get_contents($path);
|
499 |
$new_post['post_title'] = $v['title'];
|
500 |
$new_post['post_name'] = $k;
|
501 |
$new_post['post_type'] = $pagelayer->builder['name'];
|
@@ -503,23 +599,17 @@ global $pagelayer, $pl_error;
|
|
503 |
$new_post['comment_status'] = 'closed';
|
504 |
$new_post['ping_status'] = 'closed';
|
505 |
//pagelayer_print($new_post);die();
|
506 |
-
|
507 |
-
//
|
508 |
-
|
509 |
-
$new_post['post_content'] = preg_replace('/\[pl_wp_menu ([^\]]*)nav_list="(\d*)"([^\]]*)\]/is', '[pl_wp_menu ${1}nav_list="'.$menu_id.'"${3}]', $new_post['post_content']);
|
510 |
-
|
511 |
-
$GLOBALS['pagelayer_import_menu_id'] = $menu_id;
|
512 |
-
|
513 |
-
// Also for block format
|
514 |
-
$new_post['post_content'] = preg_replace_callback('/<!--\s+(?P<closer>\/)?sp:pagelayer\/pl_wp_menu\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?P<void>\/)?-->/s', 'pagelayer_handle_wp_menu', $new_post['post_content']);
|
515 |
-
|
516 |
-
}
|
517 |
|
518 |
//pagelayer_print($new_post);die();
|
519 |
|
520 |
// Now insert / update the post
|
521 |
$ret = pagelayer_insert_content($new_post, $err);
|
522 |
$post_id = $ret;
|
|
|
|
|
523 |
|
524 |
// Did we save the rev ?
|
525 |
if(empty($ret)){
|
@@ -549,93 +639,121 @@ global $pagelayer, $pl_error;
|
|
549 |
// Handle the PAGES Data
|
550 |
/////////////////////////
|
551 |
|
552 |
-
//
|
553 |
-
$data = file_get_contents($pagelayer_theme_path.'/pagelayer-data.conf');
|
554 |
-
$data = @json_decode($data, true);
|
555 |
-
//r_print($data);die();
|
556 |
-
|
557 |
-
if(empty($data['page'])){
|
558 |
-
$pl_error[] = 'Pages list not found. This is not a proper template !';
|
559 |
-
return false;
|
560 |
-
}
|
561 |
|
562 |
-
|
563 |
-
foreach($data['page'] as $k => $v){
|
564 |
|
565 |
-
$
|
566 |
|
567 |
-
//
|
568 |
-
if(
|
569 |
-
$
|
570 |
-
|
571 |
}
|
572 |
|
573 |
-
|
574 |
-
|
575 |
-
$pl_error[] = 'Something is fishy with this theme';
|
576 |
-
return false;
|
577 |
}
|
578 |
-
|
579 |
-
}
|
580 |
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
585 |
|
586 |
-
$
|
587 |
|
588 |
-
//
|
589 |
-
$
|
590 |
-
//r_print($page);
|
591 |
|
592 |
-
|
593 |
-
|
594 |
-
// It does exist so save the revision IF its the header and footer
|
595 |
-
if(!empty($page) && isset($_POST['overwrite'])){
|
596 |
|
597 |
-
|
|
|
|
|
|
|
|
|
|
|
598 |
|
599 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
600 |
|
601 |
-
|
|
|
|
|
|
|
|
|
|
|
602 |
|
603 |
-
|
604 |
-
|
605 |
-
$new_post['post_title'] = $v['post_title'];
|
606 |
-
$new_post['post_name'] = $v['post_name'];
|
607 |
-
$new_post['post_type'] = 'page';
|
608 |
-
$new_post['post_status'] = 'publish';
|
609 |
-
//r_print($new_post);die();
|
610 |
-
|
611 |
-
// Lets replace the menu we created
|
612 |
-
if(!is_wp_error($menu_id)){
|
613 |
-
$new_post['post_content'] = preg_replace('/\[pl_wp_menu ([^\]]*)nav_list="(\d*)"([^\]]*)\]/is', '[pl_wp_menu ${1}nav_list="'.$menu_id.'"${3}]', $new_post['post_content']);
|
614 |
|
615 |
-
$
|
|
|
|
|
|
|
|
|
616 |
|
617 |
-
//
|
618 |
-
$new_post['post_content'] = preg_replace_callback('/<!--\s+(?P<closer>\/)?sp:pagelayer\/pl_wp_menu\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?P<void>\/)?-->/s', 'pagelayer_handle_wp_menu', $new_post['post_content']);
|
619 |
-
}
|
620 |
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
637 |
}
|
638 |
-
|
639 |
}
|
640 |
|
641 |
// Update Post for import
|
@@ -647,8 +765,8 @@ global $pagelayer, $pl_error;
|
|
647 |
|
648 |
foreach($v as $ck => $cv){
|
649 |
|
650 |
-
if(!empty($
|
651 |
-
$cond[$ck]['id'] = $
|
652 |
}
|
653 |
|
654 |
}
|
@@ -659,13 +777,10 @@ global $pagelayer, $pl_error;
|
|
659 |
|
660 |
}
|
661 |
|
662 |
-
//
|
663 |
-
update_option('pagelayer_theme_'.$template_name.'_imported', time(), true);
|
664 |
-
|
665 |
-
// Call a function for the theme if they want to execute something
|
666 |
$ret = apply_filters('pagelayer_theme_imported', $template_name);
|
667 |
|
668 |
-
if(isset($_POST['set_home_page'])){
|
669 |
|
670 |
// Get the home page ID
|
671 |
$blog = get_page_by_path('blog');
|
@@ -689,6 +804,67 @@ global $pagelayer, $pl_error;
|
|
689 |
// Set the blog page
|
690 |
update_option('page_for_posts', $blog_id);
|
691 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
692 |
// Set the blog page
|
693 |
update_option('show_on_front', 'page');
|
694 |
|
@@ -701,18 +877,70 @@ global $pagelayer, $pl_error;
|
|
701 |
|
702 |
// Update the menu
|
703 |
if(empty($_POST['no_header_menu'])){
|
704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
}
|
706 |
|
|
|
|
|
|
|
707 |
return true;
|
708 |
|
709 |
}
|
710 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
711 |
// Create the menu
|
712 |
-
function
|
713 |
|
714 |
// Create the menu if not exists
|
715 |
-
$menu_name = (empty($name) ? 'Pagelayer' : $name)
|
716 |
$menu_exists = wp_get_nav_menu_object($menu_name);
|
717 |
|
718 |
// If there is no menu we will need to add it
|
@@ -723,14 +951,47 @@ function pagelayer_create_header_menu($name){
|
|
723 |
// Insert the Menu
|
724 |
$menu_id = wp_create_nav_menu($menu_name);
|
725 |
|
|
|
|
|
726 |
if(!is_int($menu_id)){
|
727 |
return false;
|
728 |
}
|
729 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
730 |
return $menu_id;
|
731 |
|
732 |
}
|
733 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
// Update the header menu
|
735 |
function pagelayer_update_header_menu($menu_id, $pages){
|
736 |
|
@@ -749,6 +1010,12 @@ function pagelayer_update_header_menu($menu_id, $pages){
|
|
749 |
// The other links
|
750 |
foreach($pages as $pk => $pv){
|
751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
752 |
// Skip Header, Footer and Home pages
|
753 |
if(in_array($pv, $menu_pages)){
|
754 |
continue;
|
@@ -788,7 +1055,255 @@ function pagelayer_update_header_menu($menu_id, $pages){
|
|
788 |
|
789 |
}
|
790 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
791 |
// Callback for menu replacement
|
792 |
function pagelayer_handle_wp_menu($matches){
|
793 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
}
|
49 |
$GLOBALS['pl_warn'] = __('You have already imported the content of this theme. You can re-import the same by either choosing to over-write existing pages / pagelayer templates OR creating duplicate content !', 'pagelayer');
|
50 |
}
|
51 |
|
52 |
+
|
53 |
+
|
54 |
// Call the theme
|
55 |
pagelayer_import_T();
|
56 |
|
299 |
|
300 |
}
|
301 |
|
302 |
+
// Imports the required conf
|
303 |
+
function pagelayer_import_conf(&$conf){
|
304 |
+
|
305 |
+
foreach($conf as $k => $v){
|
306 |
+
|
307 |
+
if(in_array($k, ['page_for_posts'])){
|
308 |
+
continue;
|
309 |
+
}
|
310 |
+
|
311 |
+
update_option($k, $v);
|
312 |
+
}
|
313 |
+
|
314 |
+
}
|
315 |
+
|
316 |
// The actual function to import the theme
|
317 |
function pagelayer_import_single($template_name, $items, $pagelayer_theme_path = ''){
|
318 |
|
408 |
|
409 |
}
|
410 |
|
411 |
+
//To import typography and breakpoint
|
412 |
+
if(!empty($data['conf'])){
|
413 |
+
pagelayer_import_conf($data['conf']);
|
414 |
+
}
|
415 |
+
|
416 |
return true;
|
417 |
|
418 |
}
|
419 |
|
420 |
// The actual function to import the theme
|
421 |
function pagelayer_import_theme($template_name, $pagelayer_theme_path = ''){
|
422 |
+
|
423 |
+
global $wpdb, $wp_rewrite;
|
424 |
+
global $pagelayer, $pl_error, $sitepad;
|
425 |
|
426 |
if(empty($pagelayer_theme_path)){
|
427 |
$pagelayer_theme_path = get_stylesheet_directory();
|
447 |
}
|
448 |
}
|
449 |
|
450 |
+
$pagelayer->import_links = [];
|
451 |
+
|
452 |
/////////////////////////
|
453 |
// Handle PAGELAYER DATA
|
454 |
/////////////////////////
|
462 |
return false;
|
463 |
}
|
464 |
|
465 |
+
// Load the new themes pages array
|
466 |
+
$data = file_get_contents($pagelayer_theme_path.'/pagelayer-data.conf');
|
467 |
+
$data = @json_decode($data, true);
|
468 |
+
//r_print($data);die();
|
469 |
+
|
470 |
+
if(empty($data['page'])){
|
471 |
+
$pl_error[] = 'Pages list not found. This is not a proper template !';
|
472 |
+
return false;
|
473 |
+
}
|
474 |
+
|
475 |
// Check the theme files
|
476 |
foreach($pgl as $k => $v){
|
477 |
|
479 |
//print_r($path);
|
480 |
|
481 |
// Does the page exist ?
|
482 |
+
if(!file_exists($path) || (empty($GLOBALS['sitepad']['dev']) && pagelayer_cleanpath(realpath($path)) != $path)){
|
483 |
+
$pl_error[] = 'Something is fishy with this theme as the template - '.$k.' - of type - '.$v['type'].' - was not found';
|
484 |
return false;
|
485 |
}
|
486 |
|
487 |
}
|
488 |
|
489 |
+
// Are we to add default templates ?
|
490 |
+
if(empty($_POST['no_blog_templates'])){
|
491 |
+
add_filter('pagelayer_importing_templates', 'pagelayer_blog_templates', 10, 1);
|
492 |
+
}
|
493 |
+
|
494 |
+
///////////////////////////
|
495 |
+
// Lets import all MEDIA
|
496 |
+
///////////////////////////
|
497 |
+
$_media = list_files($pagelayer_theme_path.'/images', 1);
|
498 |
+
//r_print($_media);die();
|
499 |
+
|
500 |
+
foreach($_media as $k => $v){
|
501 |
+
$file_name = basename($v);
|
502 |
+
$ret = pagelayer_upload_media($file_name, file_get_contents($v));
|
503 |
+
if(!empty($ret)){
|
504 |
+
$pagelayer->import_media['{{theme_url}}/images/'.$file_name] = $ret;
|
505 |
+
}
|
506 |
+
}
|
507 |
+
//r_print($pagelayer->import_media);die();
|
508 |
+
|
509 |
+
// If we are to import default templates
|
510 |
+
$pgl = apply_filters('pagelayer_importing_templates', $pgl);
|
511 |
+
|
512 |
+
//////////////////////
|
513 |
+
// Create Menus
|
514 |
+
//////////////////////
|
515 |
+
|
516 |
// Create the menu
|
517 |
if(empty($_POST['no_header_menu'])){
|
518 |
+
|
519 |
+
// Is there any MENU in this theme ?
|
520 |
+
if(empty($data['menus'])){
|
521 |
+
$menu_id = pagelayer_import_create_menu($template_name.' Header Menu');
|
522 |
+
}else{
|
523 |
+
|
524 |
+
foreach($data['menus'] as $k => $v){
|
525 |
+
$new_id = pagelayer_import_create_menu($v['name']);
|
526 |
+
$pagelayer->imported_menus[$v['term_id']] = $new_id;
|
527 |
+
$pagelayer->imported_menus_slug[$new_id] = $k;
|
528 |
+
}
|
529 |
+
|
530 |
+
//r_print($pagelayer->imported_menus);die();
|
531 |
+
|
532 |
+
$menu_id = current($pagelayer->imported_menus);
|
533 |
+
|
534 |
+
}
|
535 |
+
|
536 |
}else{
|
537 |
|
538 |
// Get the first menu that has items if we still can't find a menu.
|
547 |
|
548 |
}
|
549 |
|
550 |
+
// Make a array of OLD IDs => NEW IDs for replace
|
551 |
+
$pagelayer->imported_menus_preg = [];
|
552 |
+
|
553 |
+
// If we have menus !
|
554 |
+
if(!empty($pagelayer->imported_menus)){
|
555 |
+
|
556 |
+
foreach($pagelayer->imported_menus as $k => $v){
|
557 |
+
$pagelayer->imported_menus_preg['('.$k.')'] = $v;
|
558 |
+
}
|
559 |
+
|
560 |
+
// Theme didnt import menus, so lets replace with 0
|
561 |
+
}else{
|
562 |
+
$pagelayer->imported_menus_preg['(\d*)'] = $menu_id;
|
563 |
+
}
|
564 |
+
|
565 |
+
//////////////////////
|
566 |
+
// Start import
|
567 |
+
//////////////////////
|
568 |
+
|
569 |
+
// Import the Pagelayer Templates files
|
570 |
foreach($pgl as $k => $v){
|
571 |
|
572 |
$path = pagelayer_cleanpath($pagelayer_theme_path.'/'.$k.'.pgl');
|
591 |
}
|
592 |
|
593 |
// Make an array
|
594 |
+
$new_post['post_content'] = empty($v['post_content']) ? file_get_contents($path) : $v['post_content'];
|
595 |
$new_post['post_title'] = $v['title'];
|
596 |
$new_post['post_name'] = $k;
|
597 |
$new_post['post_type'] = $pagelayer->builder['name'];
|
599 |
$new_post['comment_status'] = 'closed';
|
600 |
$new_post['ping_status'] = 'closed';
|
601 |
//pagelayer_print($new_post);die();
|
602 |
+
|
603 |
+
// Handle Menu data
|
604 |
+
$new_post['post_content'] = pagelayer_import_handle_replaces($new_post['post_content']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
|
606 |
//pagelayer_print($new_post);die();
|
607 |
|
608 |
// Now insert / update the post
|
609 |
$ret = pagelayer_insert_content($new_post, $err);
|
610 |
$post_id = $ret;
|
611 |
+
$pagelayer->import_map[$k] = $ret;
|
612 |
+
$pagelayer->imported_ids[$new_post['post_type']][$new_post['post_name']] = $ret;
|
613 |
|
614 |
// Did we save the rev ?
|
615 |
if(empty($ret)){
|
639 |
// Handle the PAGES Data
|
640 |
/////////////////////////
|
641 |
|
642 |
+
//pagelayer_print($data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
|
644 |
+
foreach($data as $data_type => $data_v){
|
|
|
645 |
|
646 |
+
$pagelayer->imported[$data_type] = 1;
|
647 |
|
648 |
+
// To import theme related settings
|
649 |
+
if($data_type == 'conf'){
|
650 |
+
pagelayer_import_conf($data['conf']);
|
651 |
+
continue;
|
652 |
}
|
653 |
|
654 |
+
if($data_type == 'menus'){
|
655 |
+
continue;
|
|
|
|
|
656 |
}
|
|
|
|
|
657 |
|
658 |
+
// Check the theme files
|
659 |
+
foreach($data[$data_type] as $k => $v){
|
660 |
+
|
661 |
+
$path = pagelayer_cleanpath($pagelayer_theme_path.'/data/'.$data_type.'/'.$k);
|
662 |
+
|
663 |
+
// Does it have the title and slug ?
|
664 |
+
if(empty($v['post_title']) || empty($v['post_name'])){
|
665 |
+
$pl_error[] = 'Something is fishy with this theme as there is no title or slug for '.$k;
|
666 |
+
return false;
|
667 |
+
}
|
668 |
+
|
669 |
+
// Does the file exist ?
|
670 |
+
if(!file_exists($path) || (empty($GLOBALS['sitepad']['dev']) && pagelayer_cleanpath(realpath($path)) != $path)){
|
671 |
+
$pl_error[] = 'Something is fishy with this theme';
|
672 |
+
return false;
|
673 |
+
}
|
674 |
+
|
675 |
+
}
|
676 |
|
677 |
+
$menu_pages = [];
|
678 |
|
679 |
+
// Now check the pages if it exist in this installation ?
|
680 |
+
foreach($data[$data_type] as $k => $v){
|
|
|
681 |
|
682 |
+
$path = pagelayer_cleanpath($pagelayer_theme_path.'/data/'.$data_type.'/'.$k);
|
|
|
|
|
|
|
683 |
|
684 |
+
// Is the page there ?
|
685 |
+
$page = get_page_by_path($v['post_name']);
|
686 |
+
//r_print($page);
|
687 |
+
|
688 |
+
$new_post = array();
|
689 |
+
$insert_meta = 1;
|
690 |
|
691 |
+
// It does exist so save the revision IF its the header and footer
|
692 |
+
if(!empty($page)){
|
693 |
+
|
694 |
+
$insert_meta = 0;
|
695 |
+
|
696 |
+
if(isset($_POST['overwrite'])){
|
697 |
+
$rev = wp_save_post_revision($page->ID);
|
698 |
+
$new_post['ID'] = $page->ID;
|
699 |
+
$insert_meta = 1;
|
700 |
+
}
|
701 |
+
|
702 |
+
}
|
703 |
|
704 |
+
// Make an array
|
705 |
+
$new_post['post_content'] = file_get_contents($path);
|
706 |
+
$new_post['post_title'] = $v['post_title'];
|
707 |
+
$new_post['post_name'] = $v['post_name'];
|
708 |
+
$new_post['post_type'] = $data_type;
|
709 |
+
$new_post['post_status'] = 'publish';
|
710 |
|
711 |
+
// Meta file path
|
712 |
+
$meta_path = pagelayer_cleanpath($pagelayer_theme_path.'/data/'.$data_type.'/'.$k.'.meta');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
713 |
|
714 |
+
if($insert_meta && file_exists($meta_path)){
|
715 |
+
$meta_path = pagelayer_cleanpath($pagelayer_theme_path.'/data/'.$data_type.'/'.$k.'.meta');
|
716 |
+
$new_post['meta_input'] = file_get_contents($meta_path);
|
717 |
+
$new_post['meta_input'] = json_decode($new_post['meta_input']);
|
718 |
+
}
|
719 |
|
720 |
+
//r_print($new_post);die();
|
|
|
|
|
721 |
|
722 |
+
// Handle Menu data
|
723 |
+
$new_post['post_content'] = pagelayer_import_handle_replaces($new_post['post_content']);
|
724 |
+
|
725 |
+
// Now insert / update the post
|
726 |
+
$ret = pagelayer_insert_content($new_post, $err);
|
727 |
+
|
728 |
+
// Did we save the post ?
|
729 |
+
if(empty($ret)){
|
730 |
+
$pl_error[] = 'Could not update the '.$data_type.' '.$v['post_name'];
|
731 |
+
return false;
|
732 |
+
}
|
733 |
+
|
734 |
+
update_post_meta($ret, 'pagelayer_imported_content', $template_name);
|
735 |
+
|
736 |
+
$pagelayer->import_map[$v['ID']] = $ret;
|
737 |
+
$pagelayer->imported_ids[$new_post['post_type']][$new_post['post_name']] = $ret;
|
738 |
+
|
739 |
+
// Skip Header, Footer and Home pages
|
740 |
+
if($data_type == 'page' && preg_match('/^home/is', $new_post['post_name'])){
|
741 |
+
$home_page = $ret;
|
742 |
+
}
|
743 |
+
|
744 |
+
if(defined('SITEPAD')){
|
745 |
+
|
746 |
+
// Does the screenshot exist ?
|
747 |
+
$screenshot_file = $pagelayer_theme_path.'/screenshots/'.$v['post_name'].'.jpg';
|
748 |
+
if(file_exists($screenshot_file)){
|
749 |
+
@mkdir($sitepad['screenshots_path'], 0755, true);
|
750 |
+
@copy($screenshot_file, $sitepad['screenshots_path'].'/'.$v['post_name'].'.jpg');
|
751 |
+
}
|
752 |
+
|
753 |
+
}
|
754 |
+
|
755 |
}
|
756 |
+
|
757 |
}
|
758 |
|
759 |
// Update Post for import
|
765 |
|
766 |
foreach($v as $ck => $cv){
|
767 |
|
768 |
+
if(!empty($pagelayer->import_map[$cv])){
|
769 |
+
$cond[$ck]['id'] = $pagelayer->import_map[$cv];
|
770 |
}
|
771 |
|
772 |
}
|
777 |
|
778 |
}
|
779 |
|
780 |
+
// Call a function for the theme if they want to execute something like create more templates, etc
|
|
|
|
|
|
|
781 |
$ret = apply_filters('pagelayer_theme_imported', $template_name);
|
782 |
|
783 |
+
if(isset($_POST['set_home_page']) || isset($_POST['create_blog_page'])){
|
784 |
|
785 |
// Get the home page ID
|
786 |
$blog = get_page_by_path('blog');
|
804 |
// Set the blog page
|
805 |
update_option('page_for_posts', $blog_id);
|
806 |
|
807 |
+
}
|
808 |
+
|
809 |
+
if(!empty($data['conf']['page_for_posts'])){
|
810 |
+
$pagelayer->import_map[$data['conf']['page_for_posts']] = $blog_id;
|
811 |
+
$pagelayer->imported_ids['page']['blog'] = $blog_id;
|
812 |
+
}
|
813 |
+
|
814 |
+
// Update any links that are to be updated
|
815 |
+
if(!empty($pagelayer->import_links)){
|
816 |
+
|
817 |
+
foreach($pagelayer->import_links as $post_type => $v){
|
818 |
+
foreach($v as $slug => $link_maps){
|
819 |
+
|
820 |
+
// Lets get the post
|
821 |
+
$tmp_post = get_post($pagelayer->imported_ids[$post_type][$slug]);
|
822 |
+
|
823 |
+
foreach($link_maps as $old_link_type => $old_link_slugs){
|
824 |
+
|
825 |
+
//pagelayer_print($old_link_slugs);die();
|
826 |
+
|
827 |
+
foreach($old_link_slugs as $old_link_slug){
|
828 |
+
|
829 |
+
// Did we have such a link ?
|
830 |
+
$new_link_id = @$pagelayer->imported_ids[$old_link_type][$old_link_slug];
|
831 |
+
|
832 |
+
// If not found, lets try to find a similar post
|
833 |
+
if(empty($new_link_id)){
|
834 |
+
|
835 |
+
$args = ['name' => $old_link_slug,
|
836 |
+
'post_type' => $old_link_type];
|
837 |
+
|
838 |
+
// Make query
|
839 |
+
$query = new WP_Query($args);
|
840 |
+
|
841 |
+
// Get post
|
842 |
+
if(!empty($query->posts)){
|
843 |
+
$link_post = current($query->posts);
|
844 |
+
//echo $old_link_slug.' - ';pagelayer_print($link_post->post_name);die();
|
845 |
+
|
846 |
+
$new_link_id = @$link_post->ID;
|
847 |
+
}
|
848 |
+
|
849 |
+
}
|
850 |
+
|
851 |
+
if(empty($new_link_id)){
|
852 |
+
continue;
|
853 |
+
}
|
854 |
+
|
855 |
+
$tmp_post->post_content = str_replace('||link_id|'.$old_link_type.'|'.$old_link_slug.'||', $new_link_id, $tmp_post->post_content);
|
856 |
+
}
|
857 |
+
}
|
858 |
+
|
859 |
+
//pagelayer_print($tmp_post);
|
860 |
+
wp_update_post($tmp_post);
|
861 |
+
}
|
862 |
+
}
|
863 |
+
|
864 |
+
}
|
865 |
+
|
866 |
+
if(isset($_POST['set_home_page'])){
|
867 |
+
|
868 |
// Set the blog page
|
869 |
update_option('show_on_front', 'page');
|
870 |
|
877 |
|
878 |
// Update the menu
|
879 |
if(empty($_POST['no_header_menu'])){
|
880 |
+
|
881 |
+
// Are we importing from the theme ?
|
882 |
+
if(!empty($pagelayer->imported_menus)){
|
883 |
+
|
884 |
+
foreach($pagelayer->imported_menus as $k => $v){
|
885 |
+
pagelayer_import_update_menus($v, $pagelayer_theme_path);
|
886 |
+
}
|
887 |
+
|
888 |
+
// We created the menu, lets update it
|
889 |
+
}else{
|
890 |
+
pagelayer_update_header_menu($menu_id, $pagelayer->import_map);
|
891 |
+
}
|
892 |
}
|
893 |
|
894 |
+
// Save that we have imported the theme
|
895 |
+
update_option('pagelayer_theme_'.$template_name.'_imported', time(), true);
|
896 |
+
|
897 |
return true;
|
898 |
|
899 |
}
|
900 |
|
901 |
+
add_filter('pagelayer_start_insert_content', 'pagelayer_import_start_insert_content');
|
902 |
+
function pagelayer_import_start_insert_content($post){
|
903 |
+
|
904 |
+
global $pagelayer;
|
905 |
+
|
906 |
+
$_post = json_encode($post);
|
907 |
+
|
908 |
+
// Does it have links ?
|
909 |
+
if(preg_match_all('/(\|\|link_id\|([\w-]*)\|([\w-]*)\|\|)/', $_post, $matches)){
|
910 |
+
foreach($matches[3] as $kk => $link){
|
911 |
+
$pagelayer->import_links[$post['post_type']][$post['post_name']][$matches[2][$kk]][] = $link;
|
912 |
+
}
|
913 |
+
//pagelayer_print($matches);pagelayer_print($pagelayer->import_links);die();
|
914 |
+
}
|
915 |
+
|
916 |
+
if(preg_match('/theme_url/is', $_post)){
|
917 |
+
$do = 1;
|
918 |
+
}
|
919 |
+
|
920 |
+
// Lets replace the images
|
921 |
+
foreach($pagelayer->import_media as $k => $v){
|
922 |
+
$_post = str_replace($k, $v, $_post);
|
923 |
+
$k = str_replace('/', '\/', $k);// Handle JSON
|
924 |
+
$_post = str_replace($k, $v, $_post);
|
925 |
+
$k = str_replace('/', '\/', addslashes($k));// Handle Doubled JSON
|
926 |
+
$_post = str_replace($k, $v, $_post);
|
927 |
+
}
|
928 |
+
|
929 |
+
$post = json_decode($_post, true);
|
930 |
+
|
931 |
+
if(!empty($do)){
|
932 |
+
//echo $_post;
|
933 |
+
//pagelayer_print($post);die();
|
934 |
+
}
|
935 |
+
|
936 |
+
return $post;
|
937 |
+
}
|
938 |
+
|
939 |
// Create the menu
|
940 |
+
function pagelayer_import_create_menu($name){
|
941 |
|
942 |
// Create the menu if not exists
|
943 |
+
$menu_name = (empty($name) ? 'Pagelayer Menu' : $name);
|
944 |
$menu_exists = wp_get_nav_menu_object($menu_name);
|
945 |
|
946 |
// If there is no menu we will need to add it
|
951 |
// Insert the Menu
|
952 |
$menu_id = wp_create_nav_menu($menu_name);
|
953 |
|
954 |
+
//r_print($menu_exists);r_print($menu_name);r_print($menu_id);die();
|
955 |
+
|
956 |
if(!is_int($menu_id)){
|
957 |
return false;
|
958 |
}
|
959 |
|
960 |
+
// We need to DISABLE auto add TEMPORARILY
|
961 |
+
$options = (array) get_option('nav_menu_options');
|
962 |
+
|
963 |
+
if (isset($options['auto_add'])){
|
964 |
+
$key = array_search($menu_id, $options['auto_add']);
|
965 |
+
|
966 |
+
if(!empty($key)){
|
967 |
+
unset($options['auto_add'][$key]);
|
968 |
+
update_option('nav_menu_options', $options);
|
969 |
+
}
|
970 |
+
}
|
971 |
+
|
972 |
return $menu_id;
|
973 |
|
974 |
}
|
975 |
|
976 |
+
// Callback for menu replacement
|
977 |
+
function pagelayer_import_handle_replaces($content){
|
978 |
+
global $pagelayer;
|
979 |
+
|
980 |
+
foreach($pagelayer->imported_menus_preg as $k => $v){
|
981 |
+
$content = preg_replace('/\[pl_wp_menu ([^\]]*)nav_list="'.$k.'"([^\]]*)\]/is', '[pl_wp_menu ${1}nav_list="'.$v.'"${3}]', $content);
|
982 |
+
}
|
983 |
+
|
984 |
+
// Also for block format
|
985 |
+
$content = preg_replace_callback('/<!--\s+(?P<closer>\/)?sp:pagelayer\/pl_wp_menu\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?P<void>\/)?-->/s', 'pagelayer_handle_wp_menu', $content);
|
986 |
+
|
987 |
+
// Lets replace the variables for social icons
|
988 |
+
$content = preg_replace_callback('/\[pl_social ([^\]]*)\]/is', 'pagelayer_handle_social_urls', $content);
|
989 |
+
|
990 |
+
$content = preg_replace_callback('/<!--\s+(?P<closer>\/)?sp:pagelayer\/pl_social\s+(?P<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?P<void>\/)?-->/s', 'pagelayer_handle_social_urls_blocks', $content);
|
991 |
+
|
992 |
+
return $content;
|
993 |
+
}
|
994 |
+
|
995 |
// Update the header menu
|
996 |
function pagelayer_update_header_menu($menu_id, $pages){
|
997 |
|
1010 |
// The other links
|
1011 |
foreach($pages as $pk => $pv){
|
1012 |
|
1013 |
+
$tmp = get_post($pv);
|
1014 |
+
|
1015 |
+
if(is_wp_error($tmp) || $tmp->post_type !== 'page'){
|
1016 |
+
continue;
|
1017 |
+
}
|
1018 |
+
|
1019 |
// Skip Header, Footer and Home pages
|
1020 |
if(in_array($pv, $menu_pages)){
|
1021 |
continue;
|
1055 |
|
1056 |
}
|
1057 |
|
1058 |
+
// For import of our exported menus
|
1059 |
+
function pagelayer_import_update_menus($menu_id, $pagelayer_theme_path = ''){
|
1060 |
+
|
1061 |
+
global $pagelayer;
|
1062 |
+
|
1063 |
+
$old_id = array_search($menu_id, $pagelayer->imported_menus);
|
1064 |
+
$slug = $pagelayer->imported_menus_slug[$menu_id];
|
1065 |
+
|
1066 |
+
$data = file_get_contents($pagelayer_theme_path.'/data/menus/'.$slug);
|
1067 |
+
$data = @json_decode($data, true);
|
1068 |
+
|
1069 |
+
$ids = [];
|
1070 |
+
|
1071 |
+
// Insert the links
|
1072 |
+
foreach($data as $k => $v){
|
1073 |
+
|
1074 |
+
$r = [];
|
1075 |
+
$r['menu-item-title'] = $v['post']['title'];
|
1076 |
+
$r['menu-item-status'] = $v['post']['post_status'];
|
1077 |
+
$r['menu-item-type'] = $v['post']['type'];
|
1078 |
+
$r['menu-item-object'] = $v['post']['object'];
|
1079 |
+
|
1080 |
+
// Any parent ?
|
1081 |
+
if(!empty($v['post']['menu_item_parent'])){
|
1082 |
+
|
1083 |
+
$parent = $ids[$v['post']['menu_item_parent']];
|
1084 |
+
|
1085 |
+
if(!empty($parent)){
|
1086 |
+
$r['menu-item-parent-id'] = $parent;
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
// Regular Data Object
|
1092 |
+
if($r['menu-item-type'] !== 'custom'){
|
1093 |
+
|
1094 |
+
$r['menu-item-object-id'] = $pagelayer->import_map[$v['post']['object_id']];
|
1095 |
+
|
1096 |
+
if(empty($r['menu-item-object-id'])){
|
1097 |
+
continue;
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
$r['menu-item-url'] = get_permalink($r['menu-item-object-id']);
|
1101 |
+
|
1102 |
+
// Custom URL
|
1103 |
+
}else{
|
1104 |
+
$r['menu-item-url'] = $v['post']['url'];
|
1105 |
+
}
|
1106 |
+
|
1107 |
+
//r_print($r);
|
1108 |
+
|
1109 |
+
$ids[$v['post']['db_id']] = wp_update_nav_menu_item($menu_id, 0, $r);
|
1110 |
+
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
// We need to enable auto add new pages
|
1114 |
+
$options = (array) get_option('nav_menu_options');
|
1115 |
+
|
1116 |
+
if (!isset($options['auto_add'])){
|
1117 |
+
$options['auto_add'] = array();
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
$options['auto_add'][] = $menu_id;
|
1121 |
+
update_option('nav_menu_options', $options);
|
1122 |
+
|
1123 |
+
}
|
1124 |
+
|
1125 |
// Callback for menu replacement
|
1126 |
function pagelayer_handle_wp_menu($matches){
|
1127 |
+
global $pagelayer;
|
1128 |
+
|
1129 |
+
foreach($pagelayer->imported_menus_preg as $k => $v){
|
1130 |
+
$matches[0] = preg_replace('/nav_list"\s*:\s*"'.$k.'"/is', 'nav_list":"'.$v.'"', $matches[0]);
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
return $matches[0];
|
1134 |
+
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
// Replace Social URLs with the one given in setup
|
1138 |
+
function pagelayer_handle_social_urls($matches){
|
1139 |
+
//r_print($matches);die();
|
1140 |
+
|
1141 |
+
// Get the icon
|
1142 |
+
preg_match('/icon=(\'|")([^\'"]*)(\'|")/is', $matches[0], $icon);
|
1143 |
+
$icon = $icon[2];
|
1144 |
+
|
1145 |
+
$urls = pagelayer_get_social_urls();
|
1146 |
+
|
1147 |
+
foreach($urls as $k => $v){
|
1148 |
+
if(preg_match('/'.preg_quote($k, '/').'/is', $icon)){
|
1149 |
+
$social_url = $v;
|
1150 |
+
break;
|
1151 |
+
}
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
if(!empty($social_url)){
|
1155 |
+
|
1156 |
+
// Is the social_url param there ?
|
1157 |
+
if(!preg_match('/social_url=/is', $matches[0])){
|
1158 |
+
$matches[0] = substr($matches[0], 0, -1).'social_url="#"]';
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
$matches[0] = preg_replace('/social_url=(\'|")([^\'"]*)(\'|")/is', 'social_url="'.$social_url.'"', $matches[0]);
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
//r_print($matches);die();
|
1165 |
+
|
1166 |
+
return $matches[0];
|
1167 |
+
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
// Replace Social URLs with the one given in setup
|
1171 |
+
function pagelayer_handle_social_urls_blocks($matches){
|
1172 |
+
|
1173 |
+
// Get the icon
|
1174 |
+
preg_match('/icon":"([^"]*)"/is', $matches[0], $icon);
|
1175 |
+
$icon = $icon[1];
|
1176 |
+
|
1177 |
+
$urls = pagelayer_get_social_urls();
|
1178 |
+
|
1179 |
+
foreach($urls as $k => $v){
|
1180 |
+
if(preg_match('/'.preg_quote($k, '/').'/is', $icon)){
|
1181 |
+
$social_url = $v;
|
1182 |
+
break;
|
1183 |
+
}
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
if(!empty($social_url)){
|
1187 |
+
|
1188 |
+
// Is the social_url param there ?
|
1189 |
+
if(!preg_match('/"social_url"/is', $matches[0])){
|
1190 |
+
$matches[0] = preg_replace('/("icon"\s*:\s*"([^"]*)")/is', '"icon":"'.$icon.'","social_url":"#"', $matches[0]);
|
1191 |
+
}
|
1192 |
+
|
1193 |
+
$matches[0] = preg_replace('/social_url"\s*:\s*"([^"]*)"/is', 'social_url":"'.$social_url.'"', $matches[0]);
|
1194 |
+
}
|
1195 |
+
|
1196 |
+
return $matches[0];
|
1197 |
+
|
1198 |
+
}
|
1199 |
+
|
1200 |
+
// Add the blog templates
|
1201 |
+
function pagelayer_blog_templates($pgl){
|
1202 |
+
|
1203 |
+
$conf = '{
|
1204 |
+
"single-template": {
|
1205 |
+
"type": "single",
|
1206 |
+
"title": "Single Template",
|
1207 |
+
"conditions": [
|
1208 |
+
{
|
1209 |
+
"type": "include",
|
1210 |
+
"template": "singular",
|
1211 |
+
"sub_template": "post",
|
1212 |
+
"id": ""
|
1213 |
+
},
|
1214 |
+
{
|
1215 |
+
"type": "include",
|
1216 |
+
"template": "singular",
|
1217 |
+
"sub_template": "attachment",
|
1218 |
+
"id": ""
|
1219 |
+
}
|
1220 |
+
]
|
1221 |
+
},
|
1222 |
+
"blog-template": {
|
1223 |
+
"type": "archive",
|
1224 |
+
"title": "Blog Template",
|
1225 |
+
"conditions": [
|
1226 |
+
{
|
1227 |
+
"type": "include",
|
1228 |
+
"template": "archives",
|
1229 |
+
"sub_template": "",
|
1230 |
+
"id": ""
|
1231 |
+
}
|
1232 |
+
]
|
1233 |
+
}
|
1234 |
+
|
1235 |
+
}';
|
1236 |
+
|
1237 |
+
$conf = json_decode($conf, true);
|
1238 |
+
|
1239 |
+
// Do we have the blog template ?
|
1240 |
+
if(empty($pgl['blog-template'])){
|
1241 |
+
|
1242 |
+
$conf['blog-template']['post_content'] = '[pl_row pagelayer-id="ffbgB5e4xPIruUJC" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
|
1243 |
+
[pl_col pagelayer-id="aF6cze85x0CVnb4I" overlay_hover_delay="400"]
|
1244 |
+
[pl_archive_title pagelayer-id="a6sL2H8c5FJDwHmL" align="left" typo=",,,,,,Solid,,,," ele_margin="0px,0px,18px,0px" font_size="28"]
|
1245 |
+
[/pl_archive_title]
|
1246 |
+
[pl_archive_posts pagelayer-id="CrFuxlpqwrKx1cok" type="default" columns="3" columns_mobile="1" col_gap="20" row_gap="40" data_padding="5,5,5,5" bg_color="#ffffff" show_thumb="true" show_title="true" meta="author,date,comments" meta_sep="|" show_content="excerpt" content_color="#121212" content_align="left" pagination="number_prev_next" thumb_size="medium_large" ratio="0.7" title_color="#0986c0" title_typo=",18,,,,,solid,,,," exc_length="10" pagi_prev_text="Previous" pagi_next_text="Next" pagi_end_size="1" pagi_mid_size="2" pagi_align="center"]
|
1247 |
+
[/pl_archive_posts]
|
1248 |
+
[/pl_col]
|
1249 |
+
[/pl_row]';
|
1250 |
+
|
1251 |
+
$pgl['blog-template'] = $conf['blog-template'];
|
1252 |
+
|
1253 |
+
}
|
1254 |
+
|
1255 |
+
// Do we have the blog template ?
|
1256 |
+
if(empty($pgl['single-template'])){
|
1257 |
+
|
1258 |
+
$conf['single-template']['post_content'] = '[pl_row pagelayer-id="TeNMIn3gRsvsyDZj" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
|
1259 |
+
[pl_col pagelayer-id="qyP2XV3ClSd9cEWM" overlay_hover_delay="400"]
|
1260 |
+
[pl_post_title pagelayer-id="nNt87422AXwZoBQg" title_color="" typo=",35,,700,,,solid,,,," align="center"]
|
1261 |
+
[/pl_post_title]
|
1262 |
+
[/pl_col]
|
1263 |
+
[/pl_row]
|
1264 |
+
[pl_row pagelayer-id="6UuOjtSrBDhWOnWG" stretch="auto" col_gap="10" width_content="fixed" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100" row_width="70%" fixed_width="70%" fixed_width_tablet="85%" fixed_width_mobile="100%"]
|
1265 |
+
[pl_col pagelayer-id="gzGSF2JVwcPcNUk6" overlay_hover_delay="400" col_width="80" col="12"]
|
1266 |
+
[pl_post_info pagelayer-id="gBDuE9nYBu0bIHyv" layout="vertical" space_between="15" align="center" icon_colors="normal" text_colors="normal"]
|
1267 |
+
[pl_post_info_list pagelayer-id="ZMZjpaTiEc9Ien3t" type="author" info_link="true" info_icon_on="true" info_icon="fas fa-user-circle"]
|
1268 |
+
[/pl_post_info_list]
|
1269 |
+
[pl_post_info_list pagelayer-id="xI8gpn9VRfPDkZ0Q" type="date" info_link="true" info_icon_on="true" info_icon="fas fa-calendar-alt" date_format="default"]
|
1270 |
+
[/pl_post_info_list]
|
1271 |
+
[pl_post_info_list pagelayer-id="LaEZYd9SjEnQHsg3" type="time" info_link="true" info_icon_on="true" info_icon="fas fa-clock" time_format="default"]
|
1272 |
+
[/pl_post_info_list]
|
1273 |
+
[pl_post_info_list pagelayer-id="9lTHiEQJQqESt6YG" type="comments" info_link="true" info_icon_on="true" info_icon="fas fa-comment"]
|
1274 |
+
[/pl_post_info_list]
|
1275 |
+
[/pl_post_info]
|
1276 |
+
[pl_post_excerpt pagelayer-id="NklzzZGW3ve1X8BS" ele_margin="15px,0px,15px,0px" align="left"]
|
1277 |
+
[/pl_post_excerpt]
|
1278 |
+
[pl_featured_img pagelayer-id="sZLiICVhGCbBTx1a" size="full" img_filter="0,100,100,0,0,100,100" caption_color="#0986c0" img_hover_delay="400" custom_size="70%,0%" align="center"]
|
1279 |
+
[/pl_featured_img]
|
1280 |
+
[pl_post_content pagelayer-id="7JbkxQEvq0skyUUl" ele_margin="35px,0px,35px,0px" font_size="NaN"]
|
1281 |
+
[/pl_post_content]
|
1282 |
+
[pl_post_info pagelayer-id="tvno5FCIKdwGa8IE" layout="horizontal" space_between="5" align="left" icon_colors="normal" text_colors="normal" input_typo=",,,,,,Solid,,,,"]
|
1283 |
+
[pl_post_info_list pagelayer-id="SwoZ4cxl3XFMLE3l" type="terms" info_link="true" info_icon_on="" info_icon="fas fa-user-circle" taxonomy="category" info_before="Category :"]
|
1284 |
+
[/pl_post_info_list]
|
1285 |
+
[pl_post_info_list pagelayer-id="sgTqNx5LkBHODkrG" type="terms" info_link="true" info_icon_on="" info_icon="fas fa-user-circle" taxonomy="post_tag" info_before="Tags :"]
|
1286 |
+
[/pl_post_info_list]
|
1287 |
+
[/pl_post_info]
|
1288 |
+
[/pl_col]
|
1289 |
+
[/pl_row]
|
1290 |
+
[pl_row pagelayer-id="heO1UxRj8lIQZ52M" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
|
1291 |
+
[pl_col pagelayer-id="s3sgObVllcHz0CB7" overlay_hover_delay="400"]
|
1292 |
+
[pl_post_nav pagelayer-id="RrRky7duRa9KGmsA" lables="true" post_title="true" arrows="true" sep_color="#bdbdbd" sep_rotate="20" sep_width="5" prev_label="Previous" next_label="Next" label_colors="normal" title_colors="normal" arrows_list="angle" icon_colors="normal"]
|
1293 |
+
[/pl_post_nav]
|
1294 |
+
[/pl_col]
|
1295 |
+
[/pl_row]
|
1296 |
+
[pl_row pagelayer-id="duGtpLrwHkOWbE0m" stretch="auto" col_gap="10" width_content="auto" row_height="default" overlay_hover_delay="400" row_shape_top_color="#227bc3" row_shape_top_width="100" row_shape_top_height="100" row_shape_bottom_color="#e44993" row_shape_bottom_width="100" row_shape_bottom_height="100"]
|
1297 |
+
[pl_col pagelayer-id="ad58IjV6dHjcRBmV" overlay_hover_delay="400"]
|
1298 |
+
[pl_post_comment pagelayer-id="bwueyBxPgdNLC1Ec" comment_skin="theme_comment" post_type="current"]
|
1299 |
+
[/pl_post_comment]
|
1300 |
+
[/pl_col]
|
1301 |
+
[/pl_row]';
|
1302 |
+
|
1303 |
+
$pgl['single-template'] = $conf['single-template'];
|
1304 |
+
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
return $pgl;
|
1308 |
+
|
1309 |
}
|
@@ -55,24 +55,6 @@ function pagelayer_meta_page(){
|
|
55 |
$current_screen = get_current_screen();
|
56 |
$current_screen->is_block_editor = 0;
|
57 |
|
58 |
-
// Enqueue Scripts
|
59 |
-
wp_enqueue_script( 'post' );
|
60 |
-
|
61 |
-
// Is support media
|
62 |
-
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
|
63 |
-
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
|
64 |
-
if ( wp_attachment_is( 'audio', $post ) ) {
|
65 |
-
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
|
66 |
-
} elseif ( wp_attachment_is( 'video', $post ) ) {
|
67 |
-
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
if ( $thumbnail_support ) {
|
72 |
-
add_thickbox();
|
73 |
-
wp_enqueue_media( array( 'post' => $post_ID ) );
|
74 |
-
}
|
75 |
-
|
76 |
$form_extra = '';
|
77 |
$form_action = 'editpost';
|
78 |
$nonce_action = 'update-post_' . $post_ID;
|
@@ -89,6 +71,9 @@ function pagelayer_meta_page(){
|
|
89 |
$priorities = array( 'high', 'sorted', 'core', 'default', 'low' );
|
90 |
$to_remove_box = array('revisionsdiv', 'commentsdiv', 'formatdiv');
|
91 |
|
|
|
|
|
|
|
92 |
// Remove Meta Boxes
|
93 |
foreach( $locations as $location ){
|
94 |
foreach( $priorities as $priority ){
|
@@ -112,6 +97,29 @@ function pagelayer_meta_page(){
|
|
112 |
return array();
|
113 |
}, 999, 3);
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
?>
|
116 |
<style type="text/css">
|
117 |
body{
|
@@ -324,7 +332,10 @@ margin-bottom: 20px;
|
|
324 |
|
325 |
<script type="text/javascript">
|
326 |
jQuery(document).ready(function(){
|
327 |
-
|
|
|
|
|
|
|
328 |
jQuery('.pagelayer-modal .pagelayer-tab-items').on('click', function(){
|
329 |
var jEle = jQuery(this);
|
330 |
var show_panel = jEle.attr('data-tab');
|
@@ -339,6 +350,9 @@ jQuery(document).ready(function(){
|
|
339 |
holder.find('[tab-panel="'+show_panel+'"]').first().show();
|
340 |
});
|
341 |
|
|
|
|
|
|
|
342 |
// TODO:- conform - Add publish option
|
343 |
var post_status = jQuery('.pagelayer-modal select[name="post_status"]');
|
344 |
var publish = post_status.find('option[value="publish"]').length > 0;
|
@@ -371,6 +385,37 @@ function pagelayer_open_body_props(){
|
|
371 |
}, 5000);
|
372 |
|
373 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
</script>
|
375 |
|
376 |
<div class="pagelayer-modal">
|
@@ -402,18 +447,13 @@ function pagelayer_open_body_props(){
|
|
402 |
?>
|
403 |
<!-- Start Tabs-->
|
404 |
<div class="pagelayer-modal-sidebar pagelayer-tab-holder">
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
<span class="dashicons dashicons-editor-code"></span> <?php _e('Header and Footer') ?>
|
413 |
-
</div>
|
414 |
-
<div class="pagelayer-sidebar-items pagelayer-tab-items" data-tab="hf_code" onclick="pagelayer_open_body_props()">
|
415 |
-
<span class="dashicons dashicons-admin-generic"></span> <?php _e('Body Style') ?>
|
416 |
-
</div>
|
417 |
</div>
|
418 |
<!-- End Tabs-->
|
419 |
<!-- Start Tab panels -->
|
@@ -450,6 +490,8 @@ function pagelayer_open_body_props(){
|
|
450 |
<div class="pagelayer-modal-content pagelayer-hidden" tab-panel="hf_code">
|
451 |
<?php pagelayer_post_hf_code(); ?>
|
452 |
</div>
|
|
|
|
|
453 |
<!-- End Tab panels -->
|
454 |
</form>
|
455 |
</div>
|
55 |
$current_screen = get_current_screen();
|
56 |
$current_screen->is_block_editor = 0;
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
$form_extra = '';
|
59 |
$form_action = 'editpost';
|
60 |
$nonce_action = 'update-post_' . $post_ID;
|
71 |
$priorities = array( 'high', 'sorted', 'core', 'default', 'low' );
|
72 |
$to_remove_box = array('revisionsdiv', 'commentsdiv', 'formatdiv');
|
73 |
|
74 |
+
// Remove meta boxes from pagelayer settings
|
75 |
+
$to_remove_box = apply_filters('pagelayer_remove_meta_boxes', $to_remove_box);
|
76 |
+
|
77 |
// Remove Meta Boxes
|
78 |
foreach( $locations as $location ){
|
79 |
foreach( $priorities as $priority ){
|
97 |
return array();
|
98 |
}, 999, 3);
|
99 |
|
100 |
+
$props_tabs = array(
|
101 |
+
'post_props' => array(
|
102 |
+
'label' => __('Properties'),
|
103 |
+
'icon' => 'dashicons dashicons-welcome-write-blog',
|
104 |
+
'class' => 'pagelayer-active-item',
|
105 |
+
),
|
106 |
+
'advanced_props' => array(
|
107 |
+
'label' => __('Advanced'),
|
108 |
+
'icon' => 'dashicons dashicons-welcome-add-page',
|
109 |
+
),
|
110 |
+
'hf_code' => array(
|
111 |
+
'label' => __('Header and Footer'),
|
112 |
+
'icon' => 'dashicons dashicons-editor-code',
|
113 |
+
),
|
114 |
+
'body_style' => array(
|
115 |
+
'label' => __('Body Style'),
|
116 |
+
'icon' => 'dashicons dashicons-admin-generic',
|
117 |
+
'attr' => 'onclick="pagelayer_open_body_props()"',
|
118 |
+
)
|
119 |
+
);
|
120 |
+
|
121 |
+
$props_tabs = apply_filters('pagelayer_post_props_tabs', $props_tabs);
|
122 |
+
|
123 |
?>
|
124 |
<style type="text/css">
|
125 |
body{
|
332 |
|
333 |
<script type="text/javascript">
|
334 |
jQuery(document).ready(function(){
|
335 |
+
|
336 |
+
// Prevent the click Inside the meta pages
|
337 |
+
pagelayer_prevent_click_metas();
|
338 |
+
|
339 |
jQuery('.pagelayer-modal .pagelayer-tab-items').on('click', function(){
|
340 |
var jEle = jQuery(this);
|
341 |
var show_panel = jEle.attr('data-tab');
|
350 |
holder.find('[tab-panel="'+show_panel+'"]').first().show();
|
351 |
});
|
352 |
|
353 |
+
// Do active tab
|
354 |
+
jQuery('.pagelayer-modal .pagelayer-tab-items.pagelayer-active-item').first().click();
|
355 |
+
|
356 |
// TODO:- conform - Add publish option
|
357 |
var post_status = jQuery('.pagelayer-modal select[name="post_status"]');
|
358 |
var publish = post_status.find('option[value="publish"]').length > 0;
|
385 |
}, 5000);
|
386 |
|
387 |
}
|
388 |
+
|
389 |
+
// Prevent the click Inside the meta pages
|
390 |
+
function pagelayer_prevent_click_metas(){
|
391 |
+
jQuery(document).on("submit", function(event){
|
392 |
+
event.preventDefault();
|
393 |
+
});
|
394 |
+
|
395 |
+
jQuery(document).on("click", function(event){
|
396 |
+
var target = jQuery(event.target);
|
397 |
+
if (target.closest("a").length > 0) {
|
398 |
+
event.preventDefault();
|
399 |
+
var href = target.closest("a").attr("href");
|
400 |
+
|
401 |
+
if(!href.match(/(http|https):\/\//g)){
|
402 |
+
return;
|
403 |
+
}
|
404 |
+
|
405 |
+
var exp = new RegExp("(http|https):\/\/"+window.location.hostname, "g");
|
406 |
+
|
407 |
+
// Open new window
|
408 |
+
if(href.match(exp)){
|
409 |
+
|
410 |
+
// Reload same window
|
411 |
+
window.parent.location.assign(href);
|
412 |
+
}else{
|
413 |
+
window.open(href, "_blank");
|
414 |
+
}
|
415 |
+
|
416 |
+
}
|
417 |
+
});
|
418 |
+
}
|
419 |
</script>
|
420 |
|
421 |
<div class="pagelayer-modal">
|
447 |
?>
|
448 |
<!-- Start Tabs-->
|
449 |
<div class="pagelayer-modal-sidebar pagelayer-tab-holder">
|
450 |
+
|
451 |
+
<?php foreach($props_tabs as $key => $props_tab){?>
|
452 |
+
<div class="pagelayer-sidebar-items pagelayer-tab-items <?php echo ( !empty($props_tab['class']) ? $props_tab['class'] : '' );?>" data-tab="<?php echo $key; ?>" <?php echo ( !empty($props_tab['attr']) ? $props_tab['attr'] : '' );?>>
|
453 |
+
<span class="<?php echo $props_tab['icon']; ?>"></span> <?php echo $props_tab['label']; ?>
|
454 |
+
</div>
|
455 |
+
<?php } ?>
|
456 |
+
|
|
|
|
|
|
|
|
|
|
|
457 |
</div>
|
458 |
<!-- End Tabs-->
|
459 |
<!-- Start Tab panels -->
|
490 |
<div class="pagelayer-modal-content pagelayer-hidden" tab-panel="hf_code">
|
491 |
<?php pagelayer_post_hf_code(); ?>
|
492 |
</div>
|
493 |
+
|
494 |
+
<?php apply_filters('pagelayer_post_props_tabs_panel', '');?>
|
495 |
<!-- End Tab panels -->
|
496 |
</form>
|
497 |
</div>
|
@@ -331,10 +331,16 @@ function pagelayer_settings_page(){
|
|
331 |
if(isset($_POST['pagelayer-fbapp-id'])){
|
332 |
$fb_app_id = $_REQUEST['pagelayer-fbapp-id'];
|
333 |
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
}
|
339 |
}
|
340 |
|
331 |
if(isset($_POST['pagelayer-fbapp-id'])){
|
332 |
$fb_app_id = $_REQUEST['pagelayer-fbapp-id'];
|
333 |
|
334 |
+
if(preg_match('/\W/is', $fb_app_id)){
|
335 |
+
$pl_error[] = 'The Facebook App ID is not correct';
|
336 |
+
}else{
|
337 |
+
|
338 |
+
// Save it
|
339 |
+
update_option( 'pagelayer-fbapp-id', $fb_app_id );
|
340 |
+
|
341 |
+
$done = 1;
|
342 |
+
|
343 |
+
}
|
344 |
}
|
345 |
}
|
346 |
|
@@ -116,6 +116,7 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
116 |
$el['tmp'] = [];
|
117 |
$el['tag'] = $final_tag;
|
118 |
$el['content'] = $content;
|
|
|
119 |
$el['selector'] = '[pagelayer-id="'.$el['id'].'"]';
|
120 |
$el['wrap'] = '[pagelayer-wrap-id="'.$el['id'].'"]';
|
121 |
|
@@ -158,6 +159,19 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
158 |
|
159 |
//echo $tab.' - '.$section.' - '.$prop.'<br>';
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
// No value set
|
162 |
if(empty($el['atts'][$prop]) && empty($el['atts'][$prop.'_tablet']) && empty($el['atts'][$prop.'_mobile'])){
|
163 |
continue;
|
@@ -211,6 +225,9 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
211 |
unset($el['atts'][$prop]);
|
212 |
unset($el['atts'][$prop.'_tablet']);
|
213 |
unset($el['atts'][$prop.'_mobile']);
|
|
|
|
|
|
|
214 |
}
|
215 |
|
216 |
}
|
@@ -249,19 +266,6 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
249 |
$el['atts'][$prop] = $el['oAtts'][$prop] = $el['atts'][$prop].$param['units'][0];
|
250 |
}
|
251 |
|
252 |
-
// Load any attachment values
|
253 |
-
if(in_array($param['type'], ['image', 'video', 'audio', 'media'])){
|
254 |
-
|
255 |
-
$attachment = ($param['type'] == 'image') ? pagelayer_image($el['atts'][$prop]) : pagelayer_attachment($el['atts'][$prop]);
|
256 |
-
|
257 |
-
if(!empty($attachment)){
|
258 |
-
foreach($attachment as $k => $v){
|
259 |
-
$el['tmp'][$prop.'-'.$k] = $v;
|
260 |
-
}
|
261 |
-
}
|
262 |
-
|
263 |
-
}
|
264 |
-
|
265 |
// Load permalink values
|
266 |
if($param['type'] == 'link'){
|
267 |
$el['tmp'][$prop] = pagelayer_permalink($el['atts'][$prop]);
|
@@ -603,8 +607,8 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
|
|
603 |
if(!empty($do_shortcode)){
|
604 |
|
605 |
$inner_content = '';
|
606 |
-
if( !empty($inner_blocks) ){
|
607 |
-
foreach($inner_blocks as $inner_block){
|
608 |
$inner_content .= render_block($inner_block);
|
609 |
}
|
610 |
}else{
|
@@ -905,11 +909,11 @@ function pagelayer_bg_video(&$el){
|
|
905 |
|
906 |
}
|
907 |
|
908 |
-
$el['atts']['vid_src'] = '<iframe src="'.$iframe_src.'autoplay=1&controls=0&showinfo=0&rel=0&autohide=1&playlist='.$videoId.'" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
909 |
|
910 |
} else if (preg_match($vimeoRegExp, $source)) {
|
911 |
|
912 |
-
$el['atts']['vid_src'] = '<iframe src="'.$iframe_src.'background=1&autoplay=1&byline=0&title=0" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
913 |
|
914 |
}else{
|
915 |
|
@@ -998,7 +1002,7 @@ function pagelayer_sc_image_slider(&$el){
|
|
998 |
}
|
999 |
|
1000 |
// The Image
|
1001 |
-
$li .= '<img class="pagelayer-img" src="'.$final_urls[$v].'">';
|
1002 |
|
1003 |
if(!empty($el['atts']['link_type'])){
|
1004 |
$li .= '</a>';
|
116 |
$el['tmp'] = [];
|
117 |
$el['tag'] = $final_tag;
|
118 |
$el['content'] = $content;
|
119 |
+
$el['inner_blocks'] = $inner_blocks;
|
120 |
$el['selector'] = '[pagelayer-id="'.$el['id'].'"]';
|
121 |
$el['wrap'] = '[pagelayer-wrap-id="'.$el['id'].'"]';
|
122 |
|
159 |
|
160 |
//echo $tab.' - '.$section.' - '.$prop.'<br>';
|
161 |
|
162 |
+
// Load any attachment values
|
163 |
+
if(in_array($param['type'], ['image', 'video', 'audio', 'media'])){
|
164 |
+
|
165 |
+
$attachment = ($param['type'] == 'image') ? pagelayer_image($el['atts'][$prop]) : pagelayer_attachment($el['atts'][$prop]);
|
166 |
+
|
167 |
+
if(!empty($attachment)){
|
168 |
+
foreach($attachment as $k => $v){
|
169 |
+
$el['tmp'][$prop.'-'.$k] = $v;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
// No value set
|
176 |
if(empty($el['atts'][$prop]) && empty($el['atts'][$prop.'_tablet']) && empty($el['atts'][$prop.'_mobile'])){
|
177 |
continue;
|
225 |
unset($el['atts'][$prop]);
|
226 |
unset($el['atts'][$prop.'_tablet']);
|
227 |
unset($el['atts'][$prop.'_mobile']);
|
228 |
+
unset($el['tmp'][$prop]);
|
229 |
+
unset($el['tmp'][$prop.'_tablet']);
|
230 |
+
unset($el['tmp'][$prop.'_mobile']);
|
231 |
}
|
232 |
|
233 |
}
|
266 |
$el['atts'][$prop] = $el['oAtts'][$prop] = $el['atts'][$prop].$param['units'][0];
|
267 |
}
|
268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
// Load permalink values
|
270 |
if($param['type'] == 'link'){
|
271 |
$el['tmp'][$prop] = pagelayer_permalink($el['atts'][$prop]);
|
607 |
if(!empty($do_shortcode)){
|
608 |
|
609 |
$inner_content = '';
|
610 |
+
if( !empty($el['inner_blocks']) ){
|
611 |
+
foreach($el['inner_blocks'] as $inner_block){
|
612 |
$inner_content .= render_block($inner_block);
|
613 |
}
|
614 |
}else{
|
909 |
|
910 |
}
|
911 |
|
912 |
+
$el['atts']['vid_src'] = '<iframe src="'.$iframe_src.'&autoplay=1&controls=0&showinfo=0&rel=0&autohide=1&playlist='.$videoId.'" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
913 |
|
914 |
} else if (preg_match($vimeoRegExp, $source)) {
|
915 |
|
916 |
+
$el['atts']['vid_src'] = '<iframe src="'.$iframe_src.'&background=1&autoplay=1&byline=0&title=0" allowfullscreen="1" webkitallowfullscreen="1" mozallowfullscreen="1" frameborder="0"></iframe>';
|
917 |
|
918 |
}else{
|
919 |
|
1002 |
}
|
1003 |
|
1004 |
// The Image
|
1005 |
+
$li .= '<img class="pagelayer-img" src="'.$final_urls[$v].'" title="'.$image['title'].'" alt="'.$image['alt'].'">';
|
1006 |
|
1007 |
if(!empty($el['atts']['link_type'])){
|
1008 |
$li .= '</a>';
|
@@ -6160,6 +6160,14 @@ pagelayer_add_shortcode(PAGELAYER_SC_PREFIX.'_service', array(
|
|
6160 |
'service_button' => 'true'
|
6161 |
),
|
6162 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6163 |
'service_button_text' => array(
|
6164 |
'type' => 'text',
|
6165 |
'label' => __pl('service_button_text_label'),
|
6160 |
'service_button' => 'true'
|
6161 |
),
|
6162 |
),
|
6163 |
+
'service_button_target' => array(
|
6164 |
+
'label' => __pl('open_link_in_new_window'),
|
6165 |
+
'type' => 'checkbox',
|
6166 |
+
'addAttr' => ['{{element}} .pagelayer-service-btn' => 'target="_blank"'],
|
6167 |
+
'req' => array(
|
6168 |
+
'!service_button_url' => ''
|
6169 |
+
)
|
6170 |
+
),
|
6171 |
'service_button_text' => array(
|
6172 |
'type' => 'text',
|
6173 |
'label' => __pl('service_button_text_label'),
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
//////////////////////////////////////////////////////////////
|
4 |
//===========================================================
|
5 |
-
//
|
6 |
//===========================================================
|
7 |
// PAGELAYER
|
8 |
// Inspired by the DESIRE to be the BEST OF ALL
|
@@ -1482,6 +1482,7 @@ function pagelayer_template_vars(){
|
|
1482 |
$replacers['{{theme_url}}'] = get_stylesheet_directory_uri();
|
1483 |
$replacers['{{theme_images}}'] = get_stylesheet_directory_uri().'/images/';
|
1484 |
$replacers['{{themes_dir}}'] = dirname(get_stylesheet_directory_uri());
|
|
|
1485 |
$replacers['{{pl_site_url}}'] = home_url();
|
1486 |
|
1487 |
return $replacers;
|
2 |
|
3 |
//////////////////////////////////////////////////////////////
|
4 |
//===========================================================
|
5 |
+
// template.php
|
6 |
//===========================================================
|
7 |
// PAGELAYER
|
8 |
// Inspired by the DESIRE to be the BEST OF ALL
|
1482 |
$replacers['{{theme_url}}'] = get_stylesheet_directory_uri();
|
1483 |
$replacers['{{theme_images}}'] = get_stylesheet_directory_uri().'/images/';
|
1484 |
$replacers['{{themes_dir}}'] = dirname(get_stylesheet_directory_uri());
|
1485 |
+
$replacers['{{content_url}}'] = dirname(dirname(dirname(get_stylesheet_directory_uri())));
|
1486 |
$replacers['{{pl_site_url}}'] = home_url();
|
1487 |
|
1488 |
return $replacers;
|
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: PageLayer
|
4 |
Plugin URI: http://wordpress.org/plugins/pagelayer/
|
5 |
Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
|
6 |
-
Version: 1.3.
|
7 |
Author: Pagelayer Team
|
8 |
Author URI: https://pagelayer.com/
|
9 |
License: LGPL v2.1
|
3 |
Plugin Name: PageLayer
|
4 |
Plugin URI: http://wordpress.org/plugins/pagelayer/
|
5 |
Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
|
6 |
+
Version: 1.3.6
|
7 |
Author: Pagelayer Team
|
8 |
Author URI: https://pagelayer.com/
|
9 |
License: LGPL v2.1
|
@@ -4,7 +4,7 @@ Tags: page builder, editor, landing page, drag-and-drop, pagelayer, form-builder
|
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.5
|
6 |
Requires PHP: 5.5
|
7 |
-
Stable tag: 1.3.
|
8 |
License: LGPL v2.1
|
9 |
License URI: http://www.gnu.org/licenses/lgpl-2.1.html
|
10 |
|
@@ -109,6 +109,24 @@ Do you have questions related to PageLayer ? Use the following links :
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
= 1.3.5 (November 9, 2020) =
|
113 |
* [Security-Fix] In the Pagelayer -> Website Settings, the output was not escaped for certain settings. We would like to thank Ram Gall from the WordFence team for pointing this out. Full disclosure will be available after 48 hours from the release of this version.
|
114 |
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.5
|
6 |
Requires PHP: 5.5
|
7 |
+
Stable tag: 1.3.6
|
8 |
License: LGPL v2.1
|
9 |
License URI: http://www.gnu.org/licenses/lgpl-2.1.html
|
10 |
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
= 1.3.6 (December 05, 2020) =
|
113 |
+
* [Improvement] Improved the export and import feature to use global font settings and exported menus and posts.
|
114 |
+
* [Improvement] Added "Open link in new window (tab)" option to the image box button.
|
115 |
+
* [Improvement] Added Hide Clip option in the animated heading widget to hide clip from the rotating heading with clip effects.
|
116 |
+
* [Task] Pagelayer has been tested with WordPress 5.6 and we have made required changes.
|
117 |
+
* [Task] In the some cases updating of a post / page was not working due to mod_security. To fix this, we are now base64 encoding strings and decoding the data in our AJAX calls.
|
118 |
+
* [Task] Added an error alert when the pagelayer live editing would fail if the post was not found. This is a very rare bug, and we will try to add more such error alerts to make the issues clearly known to the user.
|
119 |
+
* [Task] Added a check to verify the Facebook App ID format is correct when saving the same.
|
120 |
+
* [Bug-Fix] The select and spinner type properties were overlapping in some cases when the label was long. We fixed this.
|
121 |
+
* [Bug-Fix] The sub-menu of a primary menu widget contained unwanted padding. This is fixed.
|
122 |
+
* [Bug-Fix] In some cases the height of the video widget container was rendered wrong. This is fixed.
|
123 |
+
* [Bug-Fix] In some cases the set feature image option in pagelayer editor post properties was not working properly. This is fixed.
|
124 |
+
* [Bug-Fix] While editing the accordion widget, the accordion active tab was shown and hidden multiple times. This is fixed.
|
125 |
+
* [Bug-Fix] In the some cases the background video was not working properly. This is fixed.
|
126 |
+
* [Bug-Fix] In the image slider widget the alt and title attributes were missing. This is fixed.
|
127 |
+
* [Bug-Fix] In the Custom HTML widget the text field was not shown. This is fixed.
|
128 |
+
* [Bug-Fix] The pagelayer-data key was not updated properly when saving the post. This caused the data of an existing post to be put within a row. This is fixed.
|
129 |
+
|
130 |
= 1.3.5 (November 9, 2020) =
|
131 |
* [Security-Fix] In the Pagelayer -> Website Settings, the output was not escaped for certain settings. We would like to thank Ram Gall from the WordFence team for pointing this out. Full disclosure will be available after 48 hours from the release of this version.
|
132 |
|