| @@ -21,25 +21,37 @@ | ||
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | // Read the file |
| 24 | 24 | $data = ''; |
| 25 | +$data_premium = ''; | |
| 26 | +$self_path = dirname(__FILE__); | |
| 27 | +$plugins_path = dirname(dirname($self_path)); | |
| 25 | 28 | $files = array( |
| 26 | 29 | // Admin CSS |
| 27 | 30 | 'pagelayer-editor.css', |
| 31 | + 'pagelayer-icons.css', | |
| 28 | 32 | 'pagelayer-editor-frontend.css', |
| 29 | - 'trumbowyg.min.css', | |
| 30 | - 'pen.css', | |
| 31 | 33 | // Enduser CSS |
| 32 | - 'font-awesome.min.css', | |
| 34 | + 'font-awesome5.min.css', | |
| 35 | + 'font-awesome5-v4shims.css', | |
| 33 | 36 | 'nivo-lightbox.css', |
| 34 | - 'slippry.css', | |
| 37 | + 'owl.carousel.min.css', | |
| 38 | + 'owl.theme.default.min.css', | |
| 35 | 39 | 'pagelayer-frontend.css', |
| 40 | + 'premium-frontend.css', | |
| 36 | 41 | 'animate.min.css', |
| 42 | + 'chartist.min.css', | |
| 43 | + 'pagelayer-pen.css', | |
| 44 | + 'pagelayer-ai.css' | |
| 37 | 45 | ); |
| 38 | 46 | |
| 39 | 47 | // What files to give |
| 40 | 48 | $give = @$_REQUEST['give']; |
| 41 | 49 | |
| 50 | +// Premium | |
| 51 | +$premium = !empty($_REQUEST['premium']) ? $_REQUEST['premium'] : ''; | |
| 52 | +$premium_path = $plugins_path.'/pagelayer-pro/css'; | |
| 53 | + | |
| 42 | 54 | if(!empty($give)){ |
| 43 | 55 | |
| 44 | 56 | $give = explode(',', $give); |
| 45 | 57 | |
| @@ -51,9 +63,22 @@ | ||
| 51 | 63 | } |
| 52 | 64 | |
| 53 | 65 | } |
| 54 | 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 | +} | |
| 55 | 79 | |
| 80 | + | |
| 56 | 81 | // Give all |
| 57 | 82 | if(empty($final)){ |
| 58 | 83 | $final = $files; |
| 59 | 84 | } |
| @@ -59,13 +84,22 @@ | ||
| 59 | 84 | } |
| 60 | 85 | |
| 61 | 86 | foreach($final as $k => $v){ |
| 62 | 87 | //echo $k.'<br>'; |
| 63 | - $data .= file_get_contents($v)."\n\n"; | |
| 88 | + $data .= file_get_contents($self_path.'/'.$v)."\n\n"; | |
| 64 | 89 | } |
| 65 | 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 | + | |
| 66 | 100 | // We are zipping if possible |
| 67 | -if(function_exists('ob_gzhandler')){ | |
| 101 | +if(function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')){ | |
| 68 | 102 | ob_start('ob_gzhandler'); |
| 69 | 103 | } |
| 70 | 104 | |
| 71 | 105 | // Type CSS |
| @@ -71,9 +105,9 @@ | ||
| 71 | 105 | // Type CSS |
| 72 | 106 | header("Content-type: text/css; charset: UTF-8"); |
| 73 | 107 | |
| 74 | 108 | // Set a zero Mtime |
| 75 | -$filetime = filemtime('pagelayer-editor.css'); | |
| 109 | +$filetime = filemtime($self_path.'/pagelayer-editor.css'); | |
| 76 | 110 | |
| 77 | 111 | // Cache Control |
| 78 | 112 | header("Cache-Control: must-revalidate"); |
| 79 | 113 | |
| @@ -91,7 +125,18 @@ | ||
| 91 | 125 | header('Last-Modified: '.gmdate('D, d M Y H:i:s', $filetime).' GMT', true, 200); |
| 92 | 126 | |
| 93 | 127 | } |
| 94 | 128 | |
| 129 | +if(defined('DOING_AJAX') && !defined('SITEPAD')){ | |
| 130 | + $data = str_replace('../fonts/', '../wp-content/plugins/'.(basename(dirname(dirname(__FILE__)))).'/fonts/', $data); | |
| 131 | +} | |
| 132 | + | |
| 95 | 133 | echo $data; |
| 134 | +echo $data_premium; | |
| 96 | 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 | +} | |
| 97 | 142 | |