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

givejs.php in Page Builder: Pagelayer – Drag and Drop website builder 2.2.0, at js/givejs.php

174 lines 4.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 //////////////////////////////////////////////////////////////
4 //===========================================================
5 // givejs.php
6 //===========================================================
7 // PAGELAYER
8 // Inspired by the DESIRE to be the BEST OF ALL
9 // ----------------------------------------------------------
10 // Started by: Pulkit Gupta
11 // Date: 23rd Jan 2017
12 // Time: 23:00 hrs
13 // Site: http://pagelayer.com/wordpress (PAGELAYER)
14 // ----------------------------------------------------------
15 // Please Read the Terms of use at http://pagelayer.com/tos
16 // ----------------------------------------------------------
17 //===========================================================
18 // (c)Pagelayer Team
19 //===========================================================
20 //////////////////////////////////////////////////////////////
21
22 if(!empty($_REQUEST['test'])){
23 echo 1;
24 die();
25 }
26
27 // Read the file
28 $data = '';
29 $data_premium = '';
30 $self_path = dirname(__FILE__);
31 $plugins_path = dirname(dirname($self_path));
32 $files = array(
33 // Admin JS
34 'pagelayer-editor.js',
35 'widgets.js',
36 'premium.js',
37 'properties.js',
38 'base-64.min.js',
39 'slimscroll.js',
40 'vanilla-picker.min.js',
41 'tlite.min.js',
42 'pagelayer-pen.js',
43 'pagelayer-ai.js',
44 // Enduser JS
45 'imagesloaded.min.js',
46 'nivo-lightbox.min.js',
47 'owl.carousel.min.js',
48 'pagelayer-frontend.js',
49 'premium-frontend.js',
50 'wow.min.js',
51 'jquery-numerator.js',
52 'simpleParallax.min.js',
53 'chart.min.js',
54 'shuffle.min.js'
55 );
56
57 // What files to give
58 $give = @$_REQUEST['give'];
59
60 // Premium
61 $premium = !empty($_REQUEST['premium']) ? $_REQUEST['premium'] : '';
62 $premium_path = $plugins_path.'/pagelayer-pro/js';
63
64 if(!empty($give)){
65
66 $give = explode(',', $give);
67
68 // Check all files are in the supported list
69 foreach($give as $file){
70 if(in_array($file, $files)){
71 $final[md5($file)] = $file;
72 }
73 }
74
75 }
76
77 if(!empty($premium)){
78
79 $premium = explode(',', trim($premium, ','));
80
81 // Check all files are in the supported list
82 foreach($premium as $file){
83 if(in_array($file, $files)){
84 $final_premium[md5($file)] = $file;
85 }
86 }
87
88 }
89
90 // Give all
91 if(empty($final)){
92 $final = $files;
93 }
94
95 foreach($final as $k => $v){
96 //echo $k.'<br>';
97 $data .= file_get_contents($self_path.'/'.$v)."\n\n";
98 }
99
100 if(!empty($final_premium)){
101
102 foreach($final_premium as $k => $v){
103 //echo $k.'<br>';
104 $data_premium .= file_get_contents($premium_path.'/'.$v)."\n\n";
105 }
106
107 }
108
109 // We are zipping if possible
110 if(function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')){
111 ob_start('ob_gzhandler');
112 }
113
114 // Type javascript
115 header("Content-type: text/javascript; charset: UTF-8");
116
117 // Set a zero Mtime
118 $filetime = filemtime($self_path.'/pagelayer-editor.js');
119
120 // Are we to also serve Shortcodes ?
121 if(!empty($pagelayer->shortcodes)){
122 $data .= 'pagelayer_shortcodes = '.json_encode($pagelayer->shortcodes).';'."\n\n";
123 $data .= 'pagelayer_styles = '.json_encode($pagelayer->styles).';'."\n\n";
124 $data .= 'pagelayer_groups = '.json_encode($pagelayer->groups).';'."\n\n";
125 }
126
127 // Add the langs as well
128 preg_match_all('/pagelayer_l\([\'"](\w*)[\'"]\)/is', $data, $matches);
129 if(!empty($matches[1]) && function_exists('__pl')){
130 foreach($matches[1] as $lk => $lv){
131 $export_langs[$lv] = __pl($lv);
132 }
133 }
134
135 // Also add the fonts
136 if(!empty($pagelayer->fonts)){
137 $export_langs['pl_fonts_list'] = $pagelayer->fonts;
138 }
139
140 // And lang string ?
141 if(!empty($export_langs)){
142 $data .= 'pagelayer_lang = '.json_encode($export_langs).';'."\n\n";
143 }
144
145 // Cache Control
146 header("Cache-Control: must-revalidate");
147
148 // Checking if the client is validating his cache and if it is current.
149 if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $filetime)) {
150
151 // Client's cache IS current, so we just respond '304 Not Modified'.
152 header('Last-Modified: '.gmdate('D, d M Y H:i:s', $filetime).' GMT', true, 304);
153
154 return;
155
156 }else{
157
158 // Image not cached or cache outdated, we respond '200 OK' and output the image.
159 header('Last-Modified: '.gmdate('D, d M Y H:i:s', $filetime).' GMT', true, 200);
160
161 }
162
163 echo $data;
164 echo $data_premium;
165
166 // Write if we are front-end only then
167 $dev = dirname(dirname(__FILE__)).'/dev.php';
168 if(!empty($_REQUEST['write']) && file_exists($dev)){
169 include_once($dev);
170 write_js();
171 }
172
173
174