PluginProbe
Page Builder: Pagelayer – Drag and Drop website builder / 2.2.1
Page Builder: Pagelayer – Drag and Drop website builder v2.2.1
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 / css / givecss.php

givecss.php in Page Builder: Pagelayer – Drag and Drop website builder 2.2.1, at css/givecss.php

143 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 //////////////////////////////////////////////////////////////
4 //===========================================================
5 // givecss.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
23 // Read the file
24 $data = '';
25 $data_premium = '';
26 $self_path = dirname(__FILE__);
27 $plugins_path = dirname(dirname($self_path));
28 $files = array(
29 // Admin CSS
30 'pagelayer-editor.css',
31 'pagelayer-icons.css',
32 'pagelayer-editor-frontend.css',
33 // Enduser CSS
34 'font-awesome5.min.css',
35 'font-awesome5-v4shims.css',
36 'nivo-lightbox.css',
37 'owl.carousel.min.css',
38 'owl.theme.default.min.css',
39 'pagelayer-frontend.css',
40 'premium-frontend.css',
41 'animate.min.css',
42 'chartist.min.css',
43 'pagelayer-pen.css',
44 'pagelayer-ai.css'
45 );
46
47 // What files to give
48 $give = @$_REQUEST['give'];
49
50 // Premium
51 $premium = !empty($_REQUEST['premium']) ? $_REQUEST['premium'] : '';
52 $premium_path = $plugins_path.'/pagelayer-pro/css';
53
54 if(!empty($give)){
55
56 $give = explode(',', $give);
57
58 // Check all files are in the supported list
59 foreach($give as $file){
60 if(in_array($file, $files)){
61 $final[md5($file)] = $file;
62 }
63 }
64
65 }
66
67 if(!empty($premium)){
68
69 $premium = explode(',', trim($premium, ','));
70
71 // Check all files are in the supported list
72 foreach($premium as $file){
73 if(in_array($file, $files)){
74 $final_premium[md5($file)] = $file;
75 }
76 }
77
78 }
79
80
81 // Give all
82 if(empty($final)){
83 $final = $files;
84 }
85
86 foreach($final as $k => $v){
87 //echo $k.'<br>';
88 $data .= file_get_contents($self_path.'/'.$v)."\n\n";
89 }
90
91 if(!empty($final_premium)){
92
93 foreach($final_premium as $k => $v){
94 //echo $k.'<br>';
95 $data_premium .= file_get_contents($premium_path.'/'.$v)."\n\n";
96 }
97
98 }
99
100 // We are zipping if possible
101 if(function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')){
102 ob_start('ob_gzhandler');
103 }
104
105 // Type CSS
106 header("Content-type: text/css; charset: UTF-8");
107
108 // Set a zero Mtime
109 $filetime = filemtime($self_path.'/pagelayer-editor.css');
110
111 // Cache Control
112 header("Cache-Control: must-revalidate");
113
114 // Checking if the client is validating his cache and if it is current.
115 if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $filetime)) {
116
117 // Client's cache IS current, so we just respond '304 Not Modified'.
118 header('Last-Modified: '.gmdate('D, d M Y H:i:s', $filetime).' GMT', true, 304);
119
120 return;
121
122 }else{
123
124 // Image not cached or cache outdated, we respond '200 OK' and output the image.
125 header('Last-Modified: '.gmdate('D, d M Y H:i:s', $filetime).' GMT', true, 200);
126
127 }
128
129 if(defined('DOING_AJAX') && !defined('SITEPAD')){
130 $data = str_replace('../fonts/', '../wp-content/plugins/'.(basename(dirname(dirname(__FILE__)))).'/fonts/', $data);
131 }
132
133 echo $data;
134 echo $data_premium;
135
136 // Write if we are front-end only then
137 $dev = dirname(dirname(__FILE__)).'/dev.php';
138 if(!empty($_REQUEST['write']) && file_exists($dev)){
139 include_once($dev);
140 write_css();
141 }
142
143