@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - /****** |
|
| 2 | + /****** |
|
| 3 | 3 | * |
| 4 | 4 | * EditArea PHP compressor |
| 5 | 5 | * Developped by Christophe Dolivet |
@@ -8,421 +8,421 @@ discard block |
||
| 8 | 8 | * |
| 9 | 9 | ******/ |
| 10 | 10 | |
| 11 | - // CONFIG |
|
| 12 | - $param['cache_duration']= 3600 * 24 * 10; // 10 days util client cache expires |
|
| 13 | - $param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false) |
|
| 14 | - $param['debug'] = false; // Enable this option if you need debuging info |
|
| 15 | - $param['use_disk_cache']= true; // If you enable this option gzip files will be cached on disk. |
|
| 16 | - $param['use_gzip']= true; // Enable gzip compression |
|
| 17 | - // END CONFIG |
|
| 11 | + // CONFIG |
|
| 12 | + $param['cache_duration']= 3600 * 24 * 10; // 10 days util client cache expires |
|
| 13 | + $param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false) |
|
| 14 | + $param['debug'] = false; // Enable this option if you need debuging info |
|
| 15 | + $param['use_disk_cache']= true; // If you enable this option gzip files will be cached on disk. |
|
| 16 | + $param['use_gzip']= true; // Enable gzip compression |
|
| 17 | + // END CONFIG |
|
| 18 | 18 | |
| 19 | - $compressor= new Compressor($param); |
|
| 19 | + $compressor= new Compressor($param); |
|
| 20 | 20 | |
| 21 | - class Compressor{ |
|
| 21 | + class Compressor{ |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | - function compressor($param) |
|
| 25 | - { |
|
| 26 | - $this->__construct($param); |
|
| 27 | - } |
|
| 24 | + function compressor($param) |
|
| 25 | + { |
|
| 26 | + $this->__construct($param); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - function __construct($param) |
|
| 30 | - { |
|
| 31 | - $this->start_time= $this->get_microtime(); |
|
| 32 | - $this->file_loaded_size=0; |
|
| 33 | - $this->param= $param; |
|
| 34 | - $this->script_list=""; |
|
| 35 | - $this->path= dirname(__FILE__)."/"; |
|
| 36 | - if(isset($_GET['plugins'])){ |
|
| 37 | - $this->load_all_plugins= true; |
|
| 38 | - $this->full_cache_file= $this->path."edit_area_full_with_plugins.js"; |
|
| 39 | - $this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz"; |
|
| 40 | - }else{ |
|
| 41 | - $this->load_all_plugins= false; |
|
| 42 | - $this->full_cache_file= $this->path."edit_area_full.js"; |
|
| 43 | - $this->gzip_cache_file= $this->path."edit_area_full.gz"; |
|
| 44 | - } |
|
| 29 | + function __construct($param) |
|
| 30 | + { |
|
| 31 | + $this->start_time= $this->get_microtime(); |
|
| 32 | + $this->file_loaded_size=0; |
|
| 33 | + $this->param= $param; |
|
| 34 | + $this->script_list=""; |
|
| 35 | + $this->path= dirname(__FILE__)."/"; |
|
| 36 | + if(isset($_GET['plugins'])){ |
|
| 37 | + $this->load_all_plugins= true; |
|
| 38 | + $this->full_cache_file= $this->path."edit_area_full_with_plugins.js"; |
|
| 39 | + $this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz"; |
|
| 40 | + }else{ |
|
| 41 | + $this->load_all_plugins= false; |
|
| 42 | + $this->full_cache_file= $this->path."edit_area_full.js"; |
|
| 43 | + $this->gzip_cache_file= $this->path."edit_area_full.gz"; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $this->check_gzip_use(); |
|
| 47 | - $this->send_headers(); |
|
| 48 | - $this->check_cache(); |
|
| 49 | - $this->load_files(); |
|
| 50 | - $this->send_datas(); |
|
| 51 | - } |
|
| 46 | + $this->check_gzip_use(); |
|
| 47 | + $this->send_headers(); |
|
| 48 | + $this->check_cache(); |
|
| 49 | + $this->load_files(); |
|
| 50 | + $this->send_datas(); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - function send_headers() |
|
| 54 | - { |
|
| 55 | - header("Content-type: text/javascript; charset: UTF-8"); |
|
| 56 | - header("Vary: Accept-Encoding"); // Handle proxies |
|
| 57 | - header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) ); |
|
| 58 | - if($this->use_gzip) |
|
| 59 | - header("Content-Encoding: ".$this->gzip_enc_header); |
|
| 60 | - } |
|
| 53 | + function send_headers() |
|
| 54 | + { |
|
| 55 | + header("Content-type: text/javascript; charset: UTF-8"); |
|
| 56 | + header("Vary: Accept-Encoding"); // Handle proxies |
|
| 57 | + header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) ); |
|
| 58 | + if($this->use_gzip) |
|
| 59 | + header("Content-Encoding: ".$this->gzip_enc_header); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - function check_gzip_use() |
|
| 63 | - { |
|
| 64 | - $encodings = array(); |
|
| 65 | - $desactivate_gzip=false; |
|
| 62 | + function check_gzip_use() |
|
| 63 | + { |
|
| 64 | + $encodings = array(); |
|
| 65 | + $desactivate_gzip=false; |
|
| 66 | 66 | |
| 67 | - if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) |
|
| 68 | - $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); |
|
| 67 | + if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) |
|
| 68 | + $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); |
|
| 69 | 69 | |
| 70 | - // desactivate gzip for IE version < 7 |
|
| 71 | - if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie)) |
|
| 72 | - { |
|
| 73 | - if($ie[1]<7) |
|
| 74 | - $desactivate_gzip=true; |
|
| 75 | - } |
|
| 70 | + // desactivate gzip for IE version < 7 |
|
| 71 | + if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie)) |
|
| 72 | + { |
|
| 73 | + if($ie[1]<7) |
|
| 74 | + $desactivate_gzip=true; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - // Check for gzip header or northon internet securities |
|
| 78 | - if (!$desactivate_gzip && $this->param['use_gzip'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) { |
|
| 79 | - $this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; |
|
| 80 | - $this->use_gzip=true; |
|
| 81 | - $this->cache_file=$this->gzip_cache_file; |
|
| 82 | - }else{ |
|
| 83 | - $this->use_gzip=false; |
|
| 84 | - $this->cache_file=$this->full_cache_file; |
|
| 85 | - } |
|
| 86 | - } |
|
| 77 | + // Check for gzip header or northon internet securities |
|
| 78 | + if (!$desactivate_gzip && $this->param['use_gzip'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) { |
|
| 79 | + $this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; |
|
| 80 | + $this->use_gzip=true; |
|
| 81 | + $this->cache_file=$this->gzip_cache_file; |
|
| 82 | + }else{ |
|
| 83 | + $this->use_gzip=false; |
|
| 84 | + $this->cache_file=$this->full_cache_file; |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - function check_cache() |
|
| 89 | - { |
|
| 90 | - // Only gzip the contents if clients and server support it |
|
| 91 | - if (file_exists($this->cache_file)) { |
|
| 92 | - // check if cache file must be updated |
|
| 93 | - $cache_date=0; |
|
| 94 | - if ($dir = opendir($this->path)) { |
|
| 95 | - while (($file = readdir($dir)) !== false) { |
|
| 96 | - if(is_file($this->path.$file) && $file!="." && $file!="..") |
|
| 97 | - $cache_date= max($cache_date, filemtime($this->path.$file)); |
|
| 98 | - } |
|
| 99 | - closedir($dir); |
|
| 100 | - } |
|
| 101 | - if($this->load_all_plugins){ |
|
| 102 | - $plug_path= $this->path."plugins/"; |
|
| 103 | - if (($dir = @opendir($plug_path)) !== false) |
|
| 104 | - { |
|
| 105 | - while (($file = readdir($dir)) !== false) |
|
| 106 | - { |
|
| 107 | - if ($file !== "." && $file !== "..") |
|
| 108 | - { |
|
| 109 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 110 | - $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 111 | - } |
|
| 112 | - } |
|
| 113 | - closedir($dir); |
|
| 114 | - } |
|
| 115 | - } |
|
| 88 | + function check_cache() |
|
| 89 | + { |
|
| 90 | + // Only gzip the contents if clients and server support it |
|
| 91 | + if (file_exists($this->cache_file)) { |
|
| 92 | + // check if cache file must be updated |
|
| 93 | + $cache_date=0; |
|
| 94 | + if ($dir = opendir($this->path)) { |
|
| 95 | + while (($file = readdir($dir)) !== false) { |
|
| 96 | + if(is_file($this->path.$file) && $file!="." && $file!="..") |
|
| 97 | + $cache_date= max($cache_date, filemtime($this->path.$file)); |
|
| 98 | + } |
|
| 99 | + closedir($dir); |
|
| 100 | + } |
|
| 101 | + if($this->load_all_plugins){ |
|
| 102 | + $plug_path= $this->path."plugins/"; |
|
| 103 | + if (($dir = @opendir($plug_path)) !== false) |
|
| 104 | + { |
|
| 105 | + while (($file = readdir($dir)) !== false) |
|
| 106 | + { |
|
| 107 | + if ($file !== "." && $file !== "..") |
|
| 108 | + { |
|
| 109 | + if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 110 | + $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 111 | + } |
|
| 112 | + } |
|
| 113 | + closedir($dir); |
|
| 114 | + } |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - if(filemtime($this->cache_file) >= $cache_date){ |
|
| 118 | - // if cache file is up to date |
|
| 119 | - $last_modified = gmdate("D, d M Y H:i:s",filemtime($this->cache_file))." GMT"; |
|
| 120 | - if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && strcasecmp($_SERVER["HTTP_IF_MODIFIED_SINCE"], $last_modified) === 0) |
|
| 121 | - { |
|
| 122 | - header("HTTP/1.1 304 Not Modified"); |
|
| 123 | - header("Last-modified: ".$last_modified); |
|
| 124 | - header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
|
| 125 | - header("Pragma:"); // Tells HTTP 1.0 clients to cache |
|
| 126 | - } |
|
| 127 | - else |
|
| 128 | - { |
|
| 129 | - header("Last-modified: ".$last_modified); |
|
| 130 | - header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
|
| 131 | - header("Pragma:"); // Tells HTTP 1.0 clients to cache |
|
| 132 | - header('Content-Length: '.filesize($this->cache_file)); |
|
| 133 | - echo file_get_contents($this->cache_file); |
|
| 134 | - } |
|
| 135 | - die; |
|
| 136 | - } |
|
| 137 | - } |
|
| 138 | - return false; |
|
| 139 | - } |
|
| 117 | + if(filemtime($this->cache_file) >= $cache_date){ |
|
| 118 | + // if cache file is up to date |
|
| 119 | + $last_modified = gmdate("D, d M Y H:i:s",filemtime($this->cache_file))." GMT"; |
|
| 120 | + if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && strcasecmp($_SERVER["HTTP_IF_MODIFIED_SINCE"], $last_modified) === 0) |
|
| 121 | + { |
|
| 122 | + header("HTTP/1.1 304 Not Modified"); |
|
| 123 | + header("Last-modified: ".$last_modified); |
|
| 124 | + header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
|
| 125 | + header("Pragma:"); // Tells HTTP 1.0 clients to cache |
|
| 126 | + } |
|
| 127 | + else |
|
| 128 | + { |
|
| 129 | + header("Last-modified: ".$last_modified); |
|
| 130 | + header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
|
| 131 | + header("Pragma:"); // Tells HTTP 1.0 clients to cache |
|
| 132 | + header('Content-Length: '.filesize($this->cache_file)); |
|
| 133 | + echo file_get_contents($this->cache_file); |
|
| 134 | + } |
|
| 135 | + die; |
|
| 136 | + } |
|
| 137 | + } |
|
| 138 | + return false; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - function load_files() |
|
| 142 | - { |
|
| 143 | - $loader= $this->get_content("edit_area_loader.js")."\n"; |
|
| 141 | + function load_files() |
|
| 142 | + { |
|
| 143 | + $loader= $this->get_content("edit_area_loader.js")."\n"; |
|
| 144 | 144 | |
| 145 | - // get the list of other files to load |
|
| 146 | - $loader= preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 147 | - , "\$this->replace_scripts('script_list', '\\1', '\\2')" |
|
| 148 | - , $loader); |
|
| 145 | + // get the list of other files to load |
|
| 146 | + $loader= preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 147 | + , "\$this->replace_scripts('script_list', '\\1', '\\2')" |
|
| 148 | + , $loader); |
|
| 149 | 149 | |
| 150 | - $loader= preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 151 | - , "\$this->replace_scripts('sub_script_list', '\\1', '\\2')" |
|
| 152 | - , $loader); |
|
| 150 | + $loader= preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 151 | + , "\$this->replace_scripts('sub_script_list', '\\1', '\\2')" |
|
| 152 | + , $loader); |
|
| 153 | 153 | |
| 154 | - // replace languages names |
|
| 155 | - $reg_path= $this->path."reg_syntax/"; |
|
| 156 | - $a_displayName = array(); |
|
| 157 | - if (($dir = @opendir($reg_path)) !== false) |
|
| 158 | - { |
|
| 159 | - while (($file = readdir($dir)) !== false) |
|
| 160 | - { |
|
| 161 | - if( $file !== "." && $file !== ".." && ( $pos = strpos( $file, '.js' ) ) !== false ) |
|
| 162 | - { |
|
| 163 | - $jsContent = $this->file_get_contents( $reg_path.$file ); |
|
| 164 | - if( preg_match( '@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match ) ) |
|
| 165 | - { |
|
| 166 | - $a_displayName[] = "'". substr( $file, 0, $pos ) ."':'". htmlspecialchars( $match[3], ENT_QUOTES ) ."'"; |
|
| 167 | - } |
|
| 168 | - } |
|
| 169 | - } |
|
| 170 | - closedir($dir); |
|
| 171 | - } |
|
| 172 | - $loader = str_replace( '/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode( ",", $a_displayName ), $loader ); |
|
| 154 | + // replace languages names |
|
| 155 | + $reg_path= $this->path."reg_syntax/"; |
|
| 156 | + $a_displayName = array(); |
|
| 157 | + if (($dir = @opendir($reg_path)) !== false) |
|
| 158 | + { |
|
| 159 | + while (($file = readdir($dir)) !== false) |
|
| 160 | + { |
|
| 161 | + if( $file !== "." && $file !== ".." && ( $pos = strpos( $file, '.js' ) ) !== false ) |
|
| 162 | + { |
|
| 163 | + $jsContent = $this->file_get_contents( $reg_path.$file ); |
|
| 164 | + if( preg_match( '@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match ) ) |
|
| 165 | + { |
|
| 166 | + $a_displayName[] = "'". substr( $file, 0, $pos ) ."':'". htmlspecialchars( $match[3], ENT_QUOTES ) ."'"; |
|
| 167 | + } |
|
| 168 | + } |
|
| 169 | + } |
|
| 170 | + closedir($dir); |
|
| 171 | + } |
|
| 172 | + $loader = str_replace( '/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode( ",", $a_displayName ), $loader ); |
|
| 173 | 173 | |
| 174 | - $this->datas= $loader; |
|
| 175 | - $this->compress_javascript($this->datas); |
|
| 174 | + $this->datas= $loader; |
|
| 175 | + $this->compress_javascript($this->datas); |
|
| 176 | 176 | |
| 177 | - // load other scripts needed for the loader |
|
| 178 | - preg_match_all('/"([^"]*)"/', $this->script_list, $match); |
|
| 179 | - foreach($match[1] as $key => $value) |
|
| 180 | - { |
|
| 181 | - $content= $this->get_content(preg_replace("/\\|\//i", "", $value).".js"); |
|
| 182 | - $this->compress_javascript($content); |
|
| 183 | - $this->datas.= $content."\n"; |
|
| 184 | - } |
|
| 185 | - //$this->datas); |
|
| 186 | - //$this->datas= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $this->datas); |
|
| 177 | + // load other scripts needed for the loader |
|
| 178 | + preg_match_all('/"([^"]*)"/', $this->script_list, $match); |
|
| 179 | + foreach($match[1] as $key => $value) |
|
| 180 | + { |
|
| 181 | + $content= $this->get_content(preg_replace("/\\|\//i", "", $value).".js"); |
|
| 182 | + $this->compress_javascript($content); |
|
| 183 | + $this->datas.= $content."\n"; |
|
| 184 | + } |
|
| 185 | + //$this->datas); |
|
| 186 | + //$this->datas= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $this->datas); |
|
| 187 | 187 | |
| 188 | - // improved compression step 1/2 |
|
| 189 | - $this->datas= preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas); |
|
| 190 | - //$this->datas= str_replace(array("EditAreaLoader", "editAreaLoader", "editAreas"), array("EAL", "eAL", "eAs"), $this->datas); |
|
| 191 | - $this->datas.= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;"; |
|
| 188 | + // improved compression step 1/2 |
|
| 189 | + $this->datas= preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas); |
|
| 190 | + //$this->datas= str_replace(array("EditAreaLoader", "editAreaLoader", "editAreas"), array("EAL", "eAL", "eAs"), $this->datas); |
|
| 191 | + $this->datas.= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;"; |
|
| 192 | 192 | |
| 193 | - // load sub scripts |
|
| 194 | - $sub_scripts=""; |
|
| 195 | - $sub_scripts_list= array(); |
|
| 196 | - preg_match_all('/"([^"]*)"/', $this->sub_script_list, $match); |
|
| 197 | - foreach($match[1] as $value){ |
|
| 198 | - $sub_scripts_list[]= preg_replace("/\\|\//i", "", $value).".js"; |
|
| 199 | - } |
|
| 193 | + // load sub scripts |
|
| 194 | + $sub_scripts=""; |
|
| 195 | + $sub_scripts_list= array(); |
|
| 196 | + preg_match_all('/"([^"]*)"/', $this->sub_script_list, $match); |
|
| 197 | + foreach($match[1] as $value){ |
|
| 198 | + $sub_scripts_list[]= preg_replace("/\\|\//i", "", $value).".js"; |
|
| 199 | + } |
|
| 200 | 200 | |
| 201 | - if($this->load_all_plugins){ |
|
| 202 | - // load plugins scripts |
|
| 203 | - $plug_path= $this->path."plugins/"; |
|
| 204 | - if (($dir = @opendir($plug_path)) !== false) |
|
| 205 | - { |
|
| 206 | - while (($file = readdir($dir)) !== false) |
|
| 207 | - { |
|
| 208 | - if ($file !== "." && $file !== "..") |
|
| 209 | - { |
|
| 210 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 211 | - $sub_scripts_list[]= "plugins/".$file."/".$file.".js"; |
|
| 212 | - } |
|
| 213 | - } |
|
| 214 | - closedir($dir); |
|
| 215 | - } |
|
| 216 | - } |
|
| 201 | + if($this->load_all_plugins){ |
|
| 202 | + // load plugins scripts |
|
| 203 | + $plug_path= $this->path."plugins/"; |
|
| 204 | + if (($dir = @opendir($plug_path)) !== false) |
|
| 205 | + { |
|
| 206 | + while (($file = readdir($dir)) !== false) |
|
| 207 | + { |
|
| 208 | + if ($file !== "." && $file !== "..") |
|
| 209 | + { |
|
| 210 | + if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 211 | + $sub_scripts_list[]= "plugins/".$file."/".$file.".js"; |
|
| 212 | + } |
|
| 213 | + } |
|
| 214 | + closedir($dir); |
|
| 215 | + } |
|
| 216 | + } |
|
| 217 | 217 | |
| 218 | - foreach($sub_scripts_list as $value){ |
|
| 219 | - $sub_scripts.= $this->get_javascript_content($value); |
|
| 220 | - } |
|
| 221 | - // improved compression step 2/2 |
|
| 222 | - $sub_scripts= preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts); |
|
| 223 | - // $sub_scripts= str_replace(array("editAreaLoader", "editAreas", "editArea", "EditArea"), array("eAL", "eAs", "eA", "EA"), $sub_scripts); |
|
| 224 | - $sub_scripts.= "var editArea= eA;EditArea=EA;"; |
|
| 218 | + foreach($sub_scripts_list as $value){ |
|
| 219 | + $sub_scripts.= $this->get_javascript_content($value); |
|
| 220 | + } |
|
| 221 | + // improved compression step 2/2 |
|
| 222 | + $sub_scripts= preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts); |
|
| 223 | + // $sub_scripts= str_replace(array("editAreaLoader", "editAreas", "editArea", "EditArea"), array("eAL", "eAs", "eA", "EA"), $sub_scripts); |
|
| 224 | + $sub_scripts.= "var editArea= eA;EditArea=EA;"; |
|
| 225 | 225 | |
| 226 | 226 | |
| 227 | - // add the scripts |
|
| 228 | - // $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\";\n", $sub_scripts); |
|
| 227 | + // add the scripts |
|
| 228 | + // $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\";\n", $sub_scripts); |
|
| 229 | 229 | |
| 230 | 230 | |
| 231 | - // add the script and use a last compression |
|
| 232 | - if( $this->param['compress'] ) |
|
| 233 | - { |
|
| 234 | - $last_comp = array( 'Á' => 'this', |
|
| 235 | - 'Â' => 'textarea', |
|
| 236 | - 'Ã' => 'function', |
|
| 237 | - 'Ä' => 'prototype', |
|
| 238 | - 'Å' => 'settings', |
|
| 239 | - 'Æ' => 'length', |
|
| 240 | - 'Ç' => 'style', |
|
| 241 | - 'È' => 'parent', |
|
| 242 | - 'É' => 'last_selection', |
|
| 243 | - 'Ê' => 'value', |
|
| 244 | - 'Ë' => 'true', |
|
| 245 | - 'Ì' => 'false' |
|
| 246 | - /*, |
|
| 231 | + // add the script and use a last compression |
|
| 232 | + if( $this->param['compress'] ) |
|
| 233 | + { |
|
| 234 | + $last_comp = array( 'Á' => 'this', |
|
| 235 | + 'Â' => 'textarea', |
|
| 236 | + 'Ã' => 'function', |
|
| 237 | + 'Ä' => 'prototype', |
|
| 238 | + 'Å' => 'settings', |
|
| 239 | + 'Æ' => 'length', |
|
| 240 | + 'Ç' => 'style', |
|
| 241 | + 'È' => 'parent', |
|
| 242 | + 'É' => 'last_selection', |
|
| 243 | + 'Ê' => 'value', |
|
| 244 | + 'Ë' => 'true', |
|
| 245 | + 'Ì' => 'false' |
|
| 246 | + /*, |
|
| 247 | 247 | 'Î' => '"', |
| 248 | 248 | 'Ï' => "\n", |
| 249 | 249 | 'À' => "\r"*/); |
| 250 | - } |
|
| 251 | - else |
|
| 252 | - { |
|
| 253 | - $last_comp = array(); |
|
| 254 | - } |
|
| 250 | + } |
|
| 251 | + else |
|
| 252 | + { |
|
| 253 | + $last_comp = array(); |
|
| 254 | + } |
|
| 255 | 255 | |
| 256 | - $js_replace= ''; |
|
| 257 | - foreach( $last_comp as $key => $val ) |
|
| 258 | - $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; |
|
| 256 | + $js_replace= ''; |
|
| 257 | + foreach( $last_comp as $key => $val ) |
|
| 258 | + $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; |
|
| 259 | 259 | |
| 260 | - $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n", |
|
| 261 | - str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ), |
|
| 262 | - $js_replace); |
|
| 260 | + $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n", |
|
| 261 | + str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ), |
|
| 262 | + $js_replace); |
|
| 263 | 263 | |
| 264 | - if($this->load_all_plugins) |
|
| 265 | - $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 264 | + if($this->load_all_plugins) |
|
| 265 | + $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 266 | 266 | |
| 267 | 267 | |
| 268 | - // load the template |
|
| 269 | - $this->datas.= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html")); |
|
| 270 | - // load the css |
|
| 271 | - $this->datas.= sprintf("editAreaLoader.iframe_css= \"<style>%s</style>\";\n", $this->get_css_content("edit_area.css")); |
|
| 268 | + // load the template |
|
| 269 | + $this->datas.= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html")); |
|
| 270 | + // load the css |
|
| 271 | + $this->datas.= sprintf("editAreaLoader.iframe_css= \"<style>%s</style>\";\n", $this->get_css_content("edit_area.css")); |
|
| 272 | 272 | |
| 273 | - // $this->datas= "function editArea(){};editArea.prototype.loader= function(){alert('bouhbouh');} var a= new editArea();a.loader();"; |
|
| 273 | + // $this->datas= "function editArea(){};editArea.prototype.loader= function(){alert('bouhbouh');} var a= new editArea();a.loader();"; |
|
| 274 | 274 | |
| 275 | - } |
|
| 275 | + } |
|
| 276 | 276 | |
| 277 | - function send_datas() |
|
| 278 | - { |
|
| 279 | - if($this->param['debug']){ |
|
| 280 | - $header=sprintf("/* USE PHP COMPRESSION\n"); |
|
| 281 | - $header.=sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas)); |
|
| 282 | - if($this->use_gzip){ |
|
| 283 | - $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
|
| 284 | - $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas)); |
|
| 285 | - $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0); |
|
| 286 | - }else{ |
|
| 287 | - $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0); |
|
| 288 | - } |
|
| 289 | - $header.=sprintf(", reduced by %s%%\n", $ratio); |
|
| 290 | - $header.=sprintf("compression time: %s\n", $this->get_microtime()-$this->start_time); |
|
| 291 | - $header.=sprintf("%s\n", implode("\n", $this->infos)); |
|
| 292 | - $header.=sprintf("*/\n"); |
|
| 293 | - $this->datas= $header.$this->datas; |
|
| 294 | - } |
|
| 295 | - $mtime= time(); // ensure that the 2 disk files will have the same update time |
|
| 296 | - // generate gzip file and cahce it if using disk cache |
|
| 297 | - if($this->use_gzip){ |
|
| 298 | - $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
|
| 299 | - if($this->param['use_disk_cache']) |
|
| 300 | - $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); |
|
| 301 | - } |
|
| 277 | + function send_datas() |
|
| 278 | + { |
|
| 279 | + if($this->param['debug']){ |
|
| 280 | + $header=sprintf("/* USE PHP COMPRESSION\n"); |
|
| 281 | + $header.=sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas)); |
|
| 282 | + if($this->use_gzip){ |
|
| 283 | + $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
|
| 284 | + $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas)); |
|
| 285 | + $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0); |
|
| 286 | + }else{ |
|
| 287 | + $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0); |
|
| 288 | + } |
|
| 289 | + $header.=sprintf(", reduced by %s%%\n", $ratio); |
|
| 290 | + $header.=sprintf("compression time: %s\n", $this->get_microtime()-$this->start_time); |
|
| 291 | + $header.=sprintf("%s\n", implode("\n", $this->infos)); |
|
| 292 | + $header.=sprintf("*/\n"); |
|
| 293 | + $this->datas= $header.$this->datas; |
|
| 294 | + } |
|
| 295 | + $mtime= time(); // ensure that the 2 disk files will have the same update time |
|
| 296 | + // generate gzip file and cahce it if using disk cache |
|
| 297 | + if($this->use_gzip){ |
|
| 298 | + $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
|
| 299 | + if($this->param['use_disk_cache']) |
|
| 300 | + $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); |
|
| 301 | + } |
|
| 302 | 302 | |
| 303 | - // generate full js file and cache it if using disk cache |
|
| 304 | - if($this->param['use_disk_cache']) |
|
| 305 | - $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); |
|
| 303 | + // generate full js file and cache it if using disk cache |
|
| 304 | + if($this->param['use_disk_cache']) |
|
| 305 | + $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); |
|
| 306 | 306 | |
| 307 | - // generate output |
|
| 308 | - if($this->use_gzip) |
|
| 309 | - echo $this->gzip_datas; |
|
| 310 | - else |
|
| 311 | - echo $this->datas; |
|
| 307 | + // generate output |
|
| 308 | + if($this->use_gzip) |
|
| 309 | + echo $this->gzip_datas; |
|
| 310 | + else |
|
| 311 | + echo $this->datas; |
|
| 312 | 312 | |
| 313 | 313 | // die; |
| 314 | - } |
|
| 314 | + } |
|
| 315 | 315 | |
| 316 | 316 | |
| 317 | - function get_content($end_uri) |
|
| 318 | - { |
|
| 319 | - $end_uri=preg_replace("/\.\./", "", $end_uri); // Remove any .. (security) |
|
| 320 | - $file= $this->path.$end_uri; |
|
| 321 | - if(file_exists($file)){ |
|
| 322 | - $this->infos[]=sprintf("'%s' loaded", $end_uri); |
|
| 323 | - /*$fd = fopen($file, 'rb'); |
|
| 317 | + function get_content($end_uri) |
|
| 318 | + { |
|
| 319 | + $end_uri=preg_replace("/\.\./", "", $end_uri); // Remove any .. (security) |
|
| 320 | + $file= $this->path.$end_uri; |
|
| 321 | + if(file_exists($file)){ |
|
| 322 | + $this->infos[]=sprintf("'%s' loaded", $end_uri); |
|
| 323 | + /*$fd = fopen($file, 'rb'); |
|
| 324 | 324 | $content = fread($fd, filesize($file)); |
| 325 | 325 | fclose($fd); |
| 326 | 326 | return $content;*/ |
| 327 | - return $this->file_get_contents($file); |
|
| 328 | - }else{ |
|
| 329 | - $this->infos[]=sprintf("'%s' not loaded", $end_uri); |
|
| 330 | - return ""; |
|
| 331 | - } |
|
| 332 | - } |
|
| 327 | + return $this->file_get_contents($file); |
|
| 328 | + }else{ |
|
| 329 | + $this->infos[]=sprintf("'%s' not loaded", $end_uri); |
|
| 330 | + return ""; |
|
| 331 | + } |
|
| 332 | + } |
|
| 333 | 333 | |
| 334 | - function get_javascript_content($end_uri) |
|
| 335 | - { |
|
| 336 | - $val=$this->get_content($end_uri); |
|
| 334 | + function get_javascript_content($end_uri) |
|
| 335 | + { |
|
| 336 | + $val=$this->get_content($end_uri); |
|
| 337 | 337 | |
| 338 | - $this->compress_javascript($val); |
|
| 339 | - $this->prepare_string_for_quotes($val); |
|
| 340 | - return $val; |
|
| 341 | - } |
|
| 338 | + $this->compress_javascript($val); |
|
| 339 | + $this->prepare_string_for_quotes($val); |
|
| 340 | + return $val; |
|
| 341 | + } |
|
| 342 | 342 | |
| 343 | - function compress_javascript(&$code) |
|
| 344 | - { |
|
| 345 | - if($this->param['compress']) |
|
| 346 | - { |
|
| 347 | - // remove all comments |
|
| 348 | - // (\"(?:[^\"\\]*(?:\\\\)*(?:\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\]*(?:\\\\)*(?:\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$)) |
|
| 349 | - $code= preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); |
|
| 350 | - // remove line return, empty line and tabulation |
|
| 351 | - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 352 | - // add line break before "else" otherwise navigators can't manage to parse the file |
|
| 353 | - $code= preg_replace('/(\b(else)\b)/', "\n$1", $code); |
|
| 354 | - // remove unnecessary spaces |
|
| 355 | - $code= preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code); |
|
| 356 | - } |
|
| 357 | - } |
|
| 343 | + function compress_javascript(&$code) |
|
| 344 | + { |
|
| 345 | + if($this->param['compress']) |
|
| 346 | + { |
|
| 347 | + // remove all comments |
|
| 348 | + // (\"(?:[^\"\\]*(?:\\\\)*(?:\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\]*(?:\\\\)*(?:\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$)) |
|
| 349 | + $code= preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); |
|
| 350 | + // remove line return, empty line and tabulation |
|
| 351 | + $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 352 | + // add line break before "else" otherwise navigators can't manage to parse the file |
|
| 353 | + $code= preg_replace('/(\b(else)\b)/', "\n$1", $code); |
|
| 354 | + // remove unnecessary spaces |
|
| 355 | + $code= preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code); |
|
| 356 | + } |
|
| 357 | + } |
|
| 358 | 358 | |
| 359 | - function get_css_content($end_uri){ |
|
| 360 | - $code=$this->get_content($end_uri); |
|
| 361 | - // remove comments |
|
| 362 | - $code= preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code); |
|
| 363 | - // remove spaces |
|
| 364 | - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code); |
|
| 365 | - // remove spaces |
|
| 366 | - $code= preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code); |
|
| 359 | + function get_css_content($end_uri){ |
|
| 360 | + $code=$this->get_content($end_uri); |
|
| 361 | + // remove comments |
|
| 362 | + $code= preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code); |
|
| 363 | + // remove spaces |
|
| 364 | + $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code); |
|
| 365 | + // remove spaces |
|
| 366 | + $code= preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code); |
|
| 367 | 367 | |
| 368 | - $this->prepare_string_for_quotes($code); |
|
| 369 | - return $code; |
|
| 370 | - } |
|
| 368 | + $this->prepare_string_for_quotes($code); |
|
| 369 | + return $code; |
|
| 370 | + } |
|
| 371 | 371 | |
| 372 | - function get_html_content($end_uri){ |
|
| 373 | - $code=$this->get_content($end_uri); |
|
| 374 | - //$code= preg_replace('/(\"(?:\\\"|[^\"])*(?:\"|$))|' . "(\'(?:\\\'|[^\'])*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); |
|
| 375 | - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 376 | - $this->prepare_string_for_quotes($code); |
|
| 377 | - return $code; |
|
| 378 | - } |
|
| 372 | + function get_html_content($end_uri){ |
|
| 373 | + $code=$this->get_content($end_uri); |
|
| 374 | + //$code= preg_replace('/(\"(?:\\\"|[^\"])*(?:\"|$))|' . "(\'(?:\\\'|[^\'])*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); |
|
| 375 | + $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 376 | + $this->prepare_string_for_quotes($code); |
|
| 377 | + return $code; |
|
| 378 | + } |
|
| 379 | 379 | |
| 380 | - function prepare_string_for_quotes(&$str){ |
|
| 381 | - // prepare the code to be putted into quotes |
|
| 382 | - /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
|
| 380 | + function prepare_string_for_quotes(&$str){ |
|
| 381 | + // prepare the code to be putted into quotes |
|
| 382 | + /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
|
| 383 | 383 | $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/ |
| 384 | - $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
|
| 385 | - if($this->param['compress']) |
|
| 386 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); |
|
| 387 | - else |
|
| 388 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); |
|
| 389 | - $str= preg_replace($pattern, $replace, $str); |
|
| 390 | - } |
|
| 384 | + $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
|
| 385 | + if($this->param['compress']) |
|
| 386 | + $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); |
|
| 387 | + else |
|
| 388 | + $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); |
|
| 389 | + $str= preg_replace($pattern, $replace, $str); |
|
| 390 | + } |
|
| 391 | 391 | |
| 392 | - function replace_scripts($var, $param1, $param2) |
|
| 393 | - { |
|
| 394 | - $this->$var=stripslashes($param2); |
|
| 395 | - return $param1."[];"; |
|
| 396 | - } |
|
| 392 | + function replace_scripts($var, $param1, $param2) |
|
| 393 | + { |
|
| 394 | + $this->$var=stripslashes($param2); |
|
| 395 | + return $param1."[];"; |
|
| 396 | + } |
|
| 397 | 397 | |
| 398 | - /* for php version that have not thoses functions */ |
|
| 399 | - function file_get_contents($file) |
|
| 400 | - { |
|
| 401 | - $fd = fopen($file, 'rb'); |
|
| 402 | - $content = fread($fd, filesize($file)); |
|
| 403 | - fclose($fd); |
|
| 404 | - $this->file_loaded_size+= strlen($content); |
|
| 405 | - return $content; |
|
| 406 | - } |
|
| 398 | + /* for php version that have not thoses functions */ |
|
| 399 | + function file_get_contents($file) |
|
| 400 | + { |
|
| 401 | + $fd = fopen($file, 'rb'); |
|
| 402 | + $content = fread($fd, filesize($file)); |
|
| 403 | + fclose($fd); |
|
| 404 | + $this->file_loaded_size+= strlen($content); |
|
| 405 | + return $content; |
|
| 406 | + } |
|
| 407 | 407 | |
| 408 | - function file_put_contents($file, &$content, $mtime=-1) |
|
| 409 | - { |
|
| 410 | - if($mtime==-1) |
|
| 411 | - $mtime=time(); |
|
| 412 | - $fp = @fopen($file, "wb"); |
|
| 413 | - if ($fp) { |
|
| 414 | - fwrite($fp, $content); |
|
| 415 | - fclose($fp); |
|
| 416 | - touch($file, $mtime); |
|
| 417 | - return true; |
|
| 418 | - } |
|
| 419 | - return false; |
|
| 420 | - } |
|
| 408 | + function file_put_contents($file, &$content, $mtime=-1) |
|
| 409 | + { |
|
| 410 | + if($mtime==-1) |
|
| 411 | + $mtime=time(); |
|
| 412 | + $fp = @fopen($file, "wb"); |
|
| 413 | + if ($fp) { |
|
| 414 | + fwrite($fp, $content); |
|
| 415 | + fclose($fp); |
|
| 416 | + touch($file, $mtime); |
|
| 417 | + return true; |
|
| 418 | + } |
|
| 419 | + return false; |
|
| 420 | + } |
|
| 421 | 421 | |
| 422 | - function get_microtime() |
|
| 423 | - { |
|
| 424 | - list($usec, $sec) = explode(" ", microtime()); |
|
| 425 | - return ((float)$usec + (float)$sec); |
|
| 426 | - } |
|
| 427 | - } |
|
| 422 | + function get_microtime() |
|
| 423 | + { |
|
| 424 | + list($usec, $sec) = explode(" ", microtime()); |
|
| 425 | + return ((float)$usec + (float)$sec); |
|
| 426 | + } |
|
| 427 | + } |
|
| 428 | 428 | ?> |
@@ -9,16 +9,16 @@ discard block |
||
| 9 | 9 | ******/ |
| 10 | 10 | |
| 11 | 11 | // CONFIG |
| 12 | - $param['cache_duration']= 3600 * 24 * 10; // 10 days util client cache expires |
|
| 13 | - $param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false) |
|
| 14 | - $param['debug'] = false; // Enable this option if you need debuging info |
|
| 15 | - $param['use_disk_cache']= true; // If you enable this option gzip files will be cached on disk. |
|
| 16 | - $param['use_gzip']= true; // Enable gzip compression |
|
| 12 | + $param['cache_duration'] = 3600 * 24 * 10; // 10 days util client cache expires |
|
| 13 | + $param['compress'] = true; // enable the code compression, should be activated but it can be usefull to desactivate it for easier error retrieving (true or false) |
|
| 14 | + $param['debug'] = false; // Enable this option if you need debuging info |
|
| 15 | + $param['use_disk_cache'] = true; // If you enable this option gzip files will be cached on disk. |
|
| 16 | + $param['use_gzip'] = true; // Enable gzip compression |
|
| 17 | 17 | // END CONFIG |
| 18 | 18 | |
| 19 | - $compressor= new Compressor($param); |
|
| 19 | + $compressor = new Compressor($param); |
|
| 20 | 20 | |
| 21 | - class Compressor{ |
|
| 21 | + class Compressor { |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | function compressor($param) |
@@ -28,19 +28,19 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | function __construct($param) |
| 30 | 30 | { |
| 31 | - $this->start_time= $this->get_microtime(); |
|
| 32 | - $this->file_loaded_size=0; |
|
| 33 | - $this->param= $param; |
|
| 34 | - $this->script_list=""; |
|
| 35 | - $this->path= dirname(__FILE__)."/"; |
|
| 36 | - if(isset($_GET['plugins'])){ |
|
| 37 | - $this->load_all_plugins= true; |
|
| 38 | - $this->full_cache_file= $this->path."edit_area_full_with_plugins.js"; |
|
| 39 | - $this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz"; |
|
| 40 | - }else{ |
|
| 41 | - $this->load_all_plugins= false; |
|
| 42 | - $this->full_cache_file= $this->path."edit_area_full.js"; |
|
| 43 | - $this->gzip_cache_file= $this->path."edit_area_full.gz"; |
|
| 31 | + $this->start_time = $this->get_microtime(); |
|
| 32 | + $this->file_loaded_size = 0; |
|
| 33 | + $this->param = $param; |
|
| 34 | + $this->script_list = ""; |
|
| 35 | + $this->path = dirname(__FILE__)."/"; |
|
| 36 | + if (isset($_GET['plugins'])) { |
|
| 37 | + $this->load_all_plugins = true; |
|
| 38 | + $this->full_cache_file = $this->path."edit_area_full_with_plugins.js"; |
|
| 39 | + $this->gzip_cache_file = $this->path."edit_area_full_with_plugins.gz"; |
|
| 40 | + } else { |
|
| 41 | + $this->load_all_plugins = false; |
|
| 42 | + $this->full_cache_file = $this->path."edit_area_full.js"; |
|
| 43 | + $this->gzip_cache_file = $this->path."edit_area_full.gz"; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $this->check_gzip_use(); |
@@ -54,34 +54,34 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | header("Content-type: text/javascript; charset: UTF-8"); |
| 56 | 56 | header("Vary: Accept-Encoding"); // Handle proxies |
| 57 | - header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) ); |
|
| 58 | - if($this->use_gzip) |
|
| 57 | + header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration']))); |
|
| 58 | + if ($this->use_gzip) |
|
| 59 | 59 | header("Content-Encoding: ".$this->gzip_enc_header); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | function check_gzip_use() |
| 63 | 63 | { |
| 64 | 64 | $encodings = array(); |
| 65 | - $desactivate_gzip=false; |
|
| 65 | + $desactivate_gzip = false; |
|
| 66 | 66 | |
| 67 | 67 | if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) |
| 68 | 68 | $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); |
| 69 | 69 | |
| 70 | 70 | // desactivate gzip for IE version < 7 |
| 71 | - if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie)) |
|
| 71 | + if (preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie)) |
|
| 72 | 72 | { |
| 73 | - if($ie[1]<7) |
|
| 74 | - $desactivate_gzip=true; |
|
| 73 | + if ($ie[1] < 7) |
|
| 74 | + $desactivate_gzip = true; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // Check for gzip header or northon internet securities |
| 78 | 78 | if (!$desactivate_gzip && $this->param['use_gzip'] && (in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) { |
| 79 | - $this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; |
|
| 80 | - $this->use_gzip=true; |
|
| 81 | - $this->cache_file=$this->gzip_cache_file; |
|
| 82 | - }else{ |
|
| 83 | - $this->use_gzip=false; |
|
| 84 | - $this->cache_file=$this->full_cache_file; |
|
| 79 | + $this->gzip_enc_header = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; |
|
| 80 | + $this->use_gzip = true; |
|
| 81 | + $this->cache_file = $this->gzip_cache_file; |
|
| 82 | + } else { |
|
| 83 | + $this->use_gzip = false; |
|
| 84 | + $this->cache_file = $this->full_cache_file; |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -90,33 +90,33 @@ discard block |
||
| 90 | 90 | // Only gzip the contents if clients and server support it |
| 91 | 91 | if (file_exists($this->cache_file)) { |
| 92 | 92 | // check if cache file must be updated |
| 93 | - $cache_date=0; |
|
| 93 | + $cache_date = 0; |
|
| 94 | 94 | if ($dir = opendir($this->path)) { |
| 95 | 95 | while (($file = readdir($dir)) !== false) { |
| 96 | - if(is_file($this->path.$file) && $file!="." && $file!="..") |
|
| 97 | - $cache_date= max($cache_date, filemtime($this->path.$file)); |
|
| 96 | + if (is_file($this->path.$file) && $file != "." && $file != "..") |
|
| 97 | + $cache_date = max($cache_date, filemtime($this->path.$file)); |
|
| 98 | 98 | } |
| 99 | 99 | closedir($dir); |
| 100 | 100 | } |
| 101 | - if($this->load_all_plugins){ |
|
| 102 | - $plug_path= $this->path."plugins/"; |
|
| 101 | + if ($this->load_all_plugins) { |
|
| 102 | + $plug_path = $this->path."plugins/"; |
|
| 103 | 103 | if (($dir = @opendir($plug_path)) !== false) |
| 104 | 104 | { |
| 105 | 105 | while (($file = readdir($dir)) !== false) |
| 106 | 106 | { |
| 107 | 107 | if ($file !== "." && $file !== "..") |
| 108 | 108 | { |
| 109 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 110 | - $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 109 | + if (is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 110 | + $cache_date = max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | closedir($dir); |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if(filemtime($this->cache_file) >= $cache_date){ |
|
| 117 | + if (filemtime($this->cache_file) >= $cache_date) { |
|
| 118 | 118 | // if cache file is up to date |
| 119 | - $last_modified = gmdate("D, d M Y H:i:s",filemtime($this->cache_file))." GMT"; |
|
| 119 | + $last_modified = gmdate("D, d M Y H:i:s", filemtime($this->cache_file))." GMT"; |
|
| 120 | 120 | if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && strcasecmp($_SERVER["HTTP_IF_MODIFIED_SINCE"], $last_modified) === 0) |
| 121 | 121 | { |
| 122 | 122 | header("HTTP/1.1 304 Not Modified"); |
@@ -140,88 +140,88 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | function load_files() |
| 142 | 142 | { |
| 143 | - $loader= $this->get_content("edit_area_loader.js")."\n"; |
|
| 143 | + $loader = $this->get_content("edit_area_loader.js")."\n"; |
|
| 144 | 144 | |
| 145 | 145 | // get the list of other files to load |
| 146 | - $loader= preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 146 | + $loader = preg_replace("/(t\.scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 147 | 147 | , "\$this->replace_scripts('script_list', '\\1', '\\2')" |
| 148 | 148 | , $loader); |
| 149 | 149 | |
| 150 | - $loader= preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 150 | + $loader = preg_replace("/(t\.sub_scripts_to_load=\s*)\[([^\]]*)\];/e" |
|
| 151 | 151 | , "\$this->replace_scripts('sub_script_list', '\\1', '\\2')" |
| 152 | 152 | , $loader); |
| 153 | 153 | |
| 154 | 154 | // replace languages names |
| 155 | - $reg_path= $this->path."reg_syntax/"; |
|
| 155 | + $reg_path = $this->path."reg_syntax/"; |
|
| 156 | 156 | $a_displayName = array(); |
| 157 | 157 | if (($dir = @opendir($reg_path)) !== false) |
| 158 | 158 | { |
| 159 | 159 | while (($file = readdir($dir)) !== false) |
| 160 | 160 | { |
| 161 | - if( $file !== "." && $file !== ".." && ( $pos = strpos( $file, '.js' ) ) !== false ) |
|
| 161 | + if ($file !== "." && $file !== ".." && ($pos = strpos($file, '.js')) !== false) |
|
| 162 | 162 | { |
| 163 | - $jsContent = $this->file_get_contents( $reg_path.$file ); |
|
| 164 | - if( preg_match( '@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match ) ) |
|
| 163 | + $jsContent = $this->file_get_contents($reg_path.$file); |
|
| 164 | + if (preg_match('@(\'|")DISPLAY_NAME\1\s*:\s*(\'|")(.*)\2@', $jsContent, $match)) |
|
| 165 | 165 | { |
| 166 | - $a_displayName[] = "'". substr( $file, 0, $pos ) ."':'". htmlspecialchars( $match[3], ENT_QUOTES ) ."'"; |
|
| 166 | + $a_displayName[] = "'".substr($file, 0, $pos)."':'".htmlspecialchars($match[3], ENT_QUOTES)."'"; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | closedir($dir); |
| 171 | 171 | } |
| 172 | - $loader = str_replace( '/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode( ",", $a_displayName ), $loader ); |
|
| 172 | + $loader = str_replace('/*syntax_display_name_AUTO-FILL-BY-COMPRESSOR*/', implode(",", $a_displayName), $loader); |
|
| 173 | 173 | |
| 174 | - $this->datas= $loader; |
|
| 174 | + $this->datas = $loader; |
|
| 175 | 175 | $this->compress_javascript($this->datas); |
| 176 | 176 | |
| 177 | 177 | // load other scripts needed for the loader |
| 178 | 178 | preg_match_all('/"([^"]*)"/', $this->script_list, $match); |
| 179 | - foreach($match[1] as $key => $value) |
|
| 179 | + foreach ($match[1] as $key => $value) |
|
| 180 | 180 | { |
| 181 | - $content= $this->get_content(preg_replace("/\\|\//i", "", $value).".js"); |
|
| 181 | + $content = $this->get_content(preg_replace("/\\|\//i", "", $value).".js"); |
|
| 182 | 182 | $this->compress_javascript($content); |
| 183 | - $this->datas.= $content."\n"; |
|
| 183 | + $this->datas .= $content."\n"; |
|
| 184 | 184 | } |
| 185 | 185 | //$this->datas); |
| 186 | 186 | //$this->datas= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $this->datas); |
| 187 | 187 | |
| 188 | 188 | // improved compression step 1/2 |
| 189 | - $this->datas= preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas); |
|
| 189 | + $this->datas = preg_replace(array("/(\b)EditAreaLoader(\b)/", "/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/"), array("EAL", "eAL", "eAs"), $this->datas); |
|
| 190 | 190 | //$this->datas= str_replace(array("EditAreaLoader", "editAreaLoader", "editAreas"), array("EAL", "eAL", "eAs"), $this->datas); |
| 191 | - $this->datas.= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;"; |
|
| 191 | + $this->datas .= "var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;"; |
|
| 192 | 192 | |
| 193 | 193 | // load sub scripts |
| 194 | - $sub_scripts=""; |
|
| 195 | - $sub_scripts_list= array(); |
|
| 194 | + $sub_scripts = ""; |
|
| 195 | + $sub_scripts_list = array(); |
|
| 196 | 196 | preg_match_all('/"([^"]*)"/', $this->sub_script_list, $match); |
| 197 | - foreach($match[1] as $value){ |
|
| 198 | - $sub_scripts_list[]= preg_replace("/\\|\//i", "", $value).".js"; |
|
| 197 | + foreach ($match[1] as $value) { |
|
| 198 | + $sub_scripts_list[] = preg_replace("/\\|\//i", "", $value).".js"; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - if($this->load_all_plugins){ |
|
| 201 | + if ($this->load_all_plugins) { |
|
| 202 | 202 | // load plugins scripts |
| 203 | - $plug_path= $this->path."plugins/"; |
|
| 203 | + $plug_path = $this->path."plugins/"; |
|
| 204 | 204 | if (($dir = @opendir($plug_path)) !== false) |
| 205 | 205 | { |
| 206 | 206 | while (($file = readdir($dir)) !== false) |
| 207 | 207 | { |
| 208 | 208 | if ($file !== "." && $file !== "..") |
| 209 | 209 | { |
| 210 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 211 | - $sub_scripts_list[]= "plugins/".$file."/".$file.".js"; |
|
| 210 | + if (is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 211 | + $sub_scripts_list[] = "plugins/".$file."/".$file.".js"; |
|
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | closedir($dir); |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - foreach($sub_scripts_list as $value){ |
|
| 219 | - $sub_scripts.= $this->get_javascript_content($value); |
|
| 218 | + foreach ($sub_scripts_list as $value) { |
|
| 219 | + $sub_scripts .= $this->get_javascript_content($value); |
|
| 220 | 220 | } |
| 221 | 221 | // improved compression step 2/2 |
| 222 | - $sub_scripts= preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts); |
|
| 222 | + $sub_scripts = preg_replace(array("/(\b)editAreaLoader(\b)/", "/(\b)editAreas(\b)/", "/(\b)editArea(\b)/", "/(\b)EditArea(\b)/"), array("eAL", "eAs", "eA", "EA"), $sub_scripts); |
|
| 223 | 223 | // $sub_scripts= str_replace(array("editAreaLoader", "editAreas", "editArea", "EditArea"), array("eAL", "eAs", "eA", "EA"), $sub_scripts); |
| 224 | - $sub_scripts.= "var editArea= eA;EditArea=EA;"; |
|
| 224 | + $sub_scripts .= "var editArea= eA;EditArea=EA;"; |
|
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | // add the scripts |
@@ -229,9 +229,9 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | // add the script and use a last compression |
| 232 | - if( $this->param['compress'] ) |
|
| 232 | + if ($this->param['compress']) |
|
| 233 | 233 | { |
| 234 | - $last_comp = array( 'Á' => 'this', |
|
| 234 | + $last_comp = array('Á' => 'this', |
|
| 235 | 235 | 'Â' => 'textarea', |
| 236 | 236 | 'Ã' => 'function', |
| 237 | 237 | 'Ä' => 'prototype', |
@@ -250,25 +250,25 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | else |
| 252 | 252 | { |
| 253 | - $last_comp = array(); |
|
| 253 | + $last_comp = array(); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - $js_replace= ''; |
|
| 257 | - foreach( $last_comp as $key => $val ) |
|
| 258 | - $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; |
|
| 256 | + $js_replace = ''; |
|
| 257 | + foreach ($last_comp as $key => $val) |
|
| 258 | + $js_replace .= ".replace(/".$key."/g,'".str_replace(array("\n", "\r"), array('\n', '\r'), $val)."')"; |
|
| 259 | 259 | |
| 260 | - $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n", |
|
| 261 | - str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ), |
|
| 260 | + $this->datas .= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n", |
|
| 261 | + str_replace(array_values($last_comp), array_keys($last_comp), $sub_scripts), |
|
| 262 | 262 | $js_replace); |
| 263 | 263 | |
| 264 | - if($this->load_all_plugins) |
|
| 265 | - $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 264 | + if ($this->load_all_plugins) |
|
| 265 | + $this->datas .= "editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 266 | 266 | |
| 267 | 267 | |
| 268 | 268 | // load the template |
| 269 | - $this->datas.= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html")); |
|
| 269 | + $this->datas .= sprintf("editAreaLoader.template= \"%s\";\n", $this->get_html_content("template.html")); |
|
| 270 | 270 | // load the css |
| 271 | - $this->datas.= sprintf("editAreaLoader.iframe_css= \"<style>%s</style>\";\n", $this->get_css_content("edit_area.css")); |
|
| 271 | + $this->datas .= sprintf("editAreaLoader.iframe_css= \"<style>%s</style>\";\n", $this->get_css_content("edit_area.css")); |
|
| 272 | 272 | |
| 273 | 273 | // $this->datas= "function editArea(){};editArea.prototype.loader= function(){alert('bouhbouh');} var a= new editArea();a.loader();"; |
| 274 | 274 | |
@@ -276,36 +276,36 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | function send_datas() |
| 278 | 278 | { |
| 279 | - if($this->param['debug']){ |
|
| 280 | - $header=sprintf("/* USE PHP COMPRESSION\n"); |
|
| 281 | - $header.=sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas)); |
|
| 282 | - if($this->use_gzip){ |
|
| 283 | - $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
|
| 284 | - $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas)); |
|
| 279 | + if ($this->param['debug']) { |
|
| 280 | + $header = sprintf("/* USE PHP COMPRESSION\n"); |
|
| 281 | + $header .= sprintf("javascript size: based files: %s => PHP COMPRESSION => %s ", $this->file_loaded_size, strlen($this->datas)); |
|
| 282 | + if ($this->use_gzip) { |
|
| 283 | + $gzip_datas = gzencode($this->datas, 9, FORCE_GZIP); |
|
| 284 | + $header .= sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas)); |
|
| 285 | 285 | $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0); |
| 286 | - }else{ |
|
| 286 | + } else { |
|
| 287 | 287 | $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0); |
| 288 | 288 | } |
| 289 | - $header.=sprintf(", reduced by %s%%\n", $ratio); |
|
| 290 | - $header.=sprintf("compression time: %s\n", $this->get_microtime()-$this->start_time); |
|
| 291 | - $header.=sprintf("%s\n", implode("\n", $this->infos)); |
|
| 292 | - $header.=sprintf("*/\n"); |
|
| 293 | - $this->datas= $header.$this->datas; |
|
| 289 | + $header .= sprintf(", reduced by %s%%\n", $ratio); |
|
| 290 | + $header .= sprintf("compression time: %s\n", $this->get_microtime() - $this->start_time); |
|
| 291 | + $header .= sprintf("%s\n", implode("\n", $this->infos)); |
|
| 292 | + $header .= sprintf("*/\n"); |
|
| 293 | + $this->datas = $header.$this->datas; |
|
| 294 | 294 | } |
| 295 | - $mtime= time(); // ensure that the 2 disk files will have the same update time |
|
| 295 | + $mtime = time(); // ensure that the 2 disk files will have the same update time |
|
| 296 | 296 | // generate gzip file and cahce it if using disk cache |
| 297 | - if($this->use_gzip){ |
|
| 298 | - $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
|
| 299 | - if($this->param['use_disk_cache']) |
|
| 297 | + if ($this->use_gzip) { |
|
| 298 | + $this->gzip_datas = gzencode($this->datas, 9, FORCE_GZIP); |
|
| 299 | + if ($this->param['use_disk_cache']) |
|
| 300 | 300 | $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | // generate full js file and cache it if using disk cache |
| 304 | - if($this->param['use_disk_cache']) |
|
| 304 | + if ($this->param['use_disk_cache']) |
|
| 305 | 305 | $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); |
| 306 | 306 | |
| 307 | 307 | // generate output |
| 308 | - if($this->use_gzip) |
|
| 308 | + if ($this->use_gzip) |
|
| 309 | 309 | echo $this->gzip_datas; |
| 310 | 310 | else |
| 311 | 311 | echo $this->datas; |
@@ -316,24 +316,24 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | function get_content($end_uri) |
| 318 | 318 | { |
| 319 | - $end_uri=preg_replace("/\.\./", "", $end_uri); // Remove any .. (security) |
|
| 320 | - $file= $this->path.$end_uri; |
|
| 321 | - if(file_exists($file)){ |
|
| 322 | - $this->infos[]=sprintf("'%s' loaded", $end_uri); |
|
| 319 | + $end_uri = preg_replace("/\.\./", "", $end_uri); // Remove any .. (security) |
|
| 320 | + $file = $this->path.$end_uri; |
|
| 321 | + if (file_exists($file)) { |
|
| 322 | + $this->infos[] = sprintf("'%s' loaded", $end_uri); |
|
| 323 | 323 | /*$fd = fopen($file, 'rb'); |
| 324 | 324 | $content = fread($fd, filesize($file)); |
| 325 | 325 | fclose($fd); |
| 326 | 326 | return $content;*/ |
| 327 | 327 | return $this->file_get_contents($file); |
| 328 | - }else{ |
|
| 329 | - $this->infos[]=sprintf("'%s' not loaded", $end_uri); |
|
| 328 | + } else { |
|
| 329 | + $this->infos[] = sprintf("'%s' not loaded", $end_uri); |
|
| 330 | 330 | return ""; |
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | function get_javascript_content($end_uri) |
| 335 | 335 | { |
| 336 | - $val=$this->get_content($end_uri); |
|
| 336 | + $val = $this->get_content($end_uri); |
|
| 337 | 337 | |
| 338 | 338 | $this->compress_javascript($val); |
| 339 | 339 | $this->prepare_string_for_quotes($val); |
@@ -342,56 +342,56 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | function compress_javascript(&$code) |
| 344 | 344 | { |
| 345 | - if($this->param['compress']) |
|
| 345 | + if ($this->param['compress']) |
|
| 346 | 346 | { |
| 347 | 347 | // remove all comments |
| 348 | 348 | // (\"(?:[^\"\\]*(?:\\\\)*(?:\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\]*(?:\\\\)*(?:\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$)) |
| 349 | - $code= preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); |
|
| 349 | + $code = preg_replace("/(\"(?:[^\"\\\\]*(?:\\\\\\\\)*(?:\\\\\"?)?)*(?:\"|$))|(\'(?:[^\'\\\\]*(?:\\\\\\\\)*(?:\\\\\'?)?)*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); |
|
| 350 | 350 | // remove line return, empty line and tabulation |
| 351 | - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 351 | + $code = preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 352 | 352 | // add line break before "else" otherwise navigators can't manage to parse the file |
| 353 | - $code= preg_replace('/(\b(else)\b)/', "\n$1", $code); |
|
| 353 | + $code = preg_replace('/(\b(else)\b)/', "\n$1", $code); |
|
| 354 | 354 | // remove unnecessary spaces |
| 355 | - $code= preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code); |
|
| 355 | + $code = preg_replace('/( |\t|\r)*(;|\{|\}|=|==|\-|\+|,|\(|\)|\|\||&\&|\:)( |\t|\r)*/', "$2", $code); |
|
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | - function get_css_content($end_uri){ |
|
| 360 | - $code=$this->get_content($end_uri); |
|
| 359 | + function get_css_content($end_uri) { |
|
| 360 | + $code = $this->get_content($end_uri); |
|
| 361 | 361 | // remove comments |
| 362 | - $code= preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code); |
|
| 362 | + $code = preg_replace("/(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "", $code); |
|
| 363 | 363 | // remove spaces |
| 364 | - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code); |
|
| 364 | + $code = preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', "", $code); |
|
| 365 | 365 | // remove spaces |
| 366 | - $code= preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code); |
|
| 366 | + $code = preg_replace('/( |\t|\r)?(\:|,|\{|\})( |\t|\r)+/', "$2", $code); |
|
| 367 | 367 | |
| 368 | 368 | $this->prepare_string_for_quotes($code); |
| 369 | 369 | return $code; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - function get_html_content($end_uri){ |
|
| 373 | - $code=$this->get_content($end_uri); |
|
| 372 | + function get_html_content($end_uri) { |
|
| 373 | + $code = $this->get_content($end_uri); |
|
| 374 | 374 | //$code= preg_replace('/(\"(?:\\\"|[^\"])*(?:\"|$))|' . "(\'(?:\\\'|[^\'])*(?:\'|$))|(?:\/\/(?:.|\r|\t)*?(\n|$))|(?:\/\*(?:.|\n|\r|\t)*?(?:\*\/|$))/s", "$1$2$3", $code); |
| 375 | - $code= preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 375 | + $code = preg_replace('/(( |\t|\r)*\n( |\t)*)+/s', " ", $code); |
|
| 376 | 376 | $this->prepare_string_for_quotes($code); |
| 377 | 377 | return $code; |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - function prepare_string_for_quotes(&$str){ |
|
| 380 | + function prepare_string_for_quotes(&$str) { |
|
| 381 | 381 | // prepare the code to be putted into quotes |
| 382 | 382 | /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
| 383 | 383 | $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/ |
| 384 | - $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
|
| 385 | - if($this->param['compress']) |
|
| 386 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); |
|
| 384 | + $pattern = array("/(\\\\)?\"/", '/\\\n/', '/\\\r/', "/(\r?\n)/"); |
|
| 385 | + if ($this->param['compress']) |
|
| 386 | + $replace = array('$1$1\\"', '\\\\\\n', '\\\\\\r', '\n'); |
|
| 387 | 387 | else |
| 388 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); |
|
| 389 | - $str= preg_replace($pattern, $replace, $str); |
|
| 388 | + $replace = array('$1$1\\"', '\\\\\\n', '\\\\\\r', "\\n\"\n+\""); |
|
| 389 | + $str = preg_replace($pattern, $replace, $str); |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | function replace_scripts($var, $param1, $param2) |
| 393 | 393 | { |
| 394 | - $this->$var=stripslashes($param2); |
|
| 394 | + $this->$var = stripslashes($param2); |
|
| 395 | 395 | return $param1."[];"; |
| 396 | 396 | } |
| 397 | 397 | |
@@ -401,14 +401,14 @@ discard block |
||
| 401 | 401 | $fd = fopen($file, 'rb'); |
| 402 | 402 | $content = fread($fd, filesize($file)); |
| 403 | 403 | fclose($fd); |
| 404 | - $this->file_loaded_size+= strlen($content); |
|
| 404 | + $this->file_loaded_size += strlen($content); |
|
| 405 | 405 | return $content; |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | - function file_put_contents($file, &$content, $mtime=-1) |
|
| 408 | + function file_put_contents($file, &$content, $mtime = -1) |
|
| 409 | 409 | { |
| 410 | - if($mtime==-1) |
|
| 411 | - $mtime=time(); |
|
| 410 | + if ($mtime == -1) |
|
| 411 | + $mtime = time(); |
|
| 412 | 412 | $fp = @fopen($file, "wb"); |
| 413 | 413 | if ($fp) { |
| 414 | 414 | fwrite($fp, $content); |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | function get_microtime() |
| 423 | 423 | { |
| 424 | 424 | list($usec, $sec) = explode(" ", microtime()); |
| 425 | - return ((float)$usec + (float)$sec); |
|
| 425 | + return ((float) $usec + (float) $sec); |
|
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | ?> |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->load_all_plugins= true; |
| 38 | 38 | $this->full_cache_file= $this->path."edit_area_full_with_plugins.js"; |
| 39 | 39 | $this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz"; |
| 40 | - }else{ |
|
| 40 | + } else{ |
|
| 41 | 41 | $this->load_all_plugins= false; |
| 42 | 42 | $this->full_cache_file= $this->path."edit_area_full.js"; |
| 43 | 43 | $this->gzip_cache_file= $this->path."edit_area_full.gz"; |
@@ -55,8 +55,9 @@ discard block |
||
| 55 | 55 | header("Content-type: text/javascript; charset: UTF-8"); |
| 56 | 56 | header("Vary: Accept-Encoding"); // Handle proxies |
| 57 | 57 | header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) ); |
| 58 | - if($this->use_gzip) |
|
| 59 | - header("Content-Encoding: ".$this->gzip_enc_header); |
|
| 58 | + if($this->use_gzip) { |
|
| 59 | + header("Content-Encoding: ".$this->gzip_enc_header); |
|
| 60 | + } |
|
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 | function check_gzip_use() |
@@ -64,14 +65,16 @@ discard block |
||
| 64 | 65 | $encodings = array(); |
| 65 | 66 | $desactivate_gzip=false; |
| 66 | 67 | |
| 67 | - if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) |
|
| 68 | - $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); |
|
| 68 | + if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { |
|
| 69 | + $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); |
|
| 70 | + } |
|
| 69 | 71 | |
| 70 | 72 | // desactivate gzip for IE version < 7 |
| 71 | 73 | if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie)) |
| 72 | 74 | { |
| 73 | - if($ie[1]<7) |
|
| 74 | - $desactivate_gzip=true; |
|
| 75 | + if($ie[1]<7) { |
|
| 76 | + $desactivate_gzip=true; |
|
| 77 | + } |
|
| 75 | 78 | } |
| 76 | 79 | |
| 77 | 80 | // Check for gzip header or northon internet securities |
@@ -79,7 +82,7 @@ discard block |
||
| 79 | 82 | $this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; |
| 80 | 83 | $this->use_gzip=true; |
| 81 | 84 | $this->cache_file=$this->gzip_cache_file; |
| 82 | - }else{ |
|
| 85 | + } else{ |
|
| 83 | 86 | $this->use_gzip=false; |
| 84 | 87 | $this->cache_file=$this->full_cache_file; |
| 85 | 88 | } |
@@ -93,8 +96,9 @@ discard block |
||
| 93 | 96 | $cache_date=0; |
| 94 | 97 | if ($dir = opendir($this->path)) { |
| 95 | 98 | while (($file = readdir($dir)) !== false) { |
| 96 | - if(is_file($this->path.$file) && $file!="." && $file!="..") |
|
| 97 | - $cache_date= max($cache_date, filemtime($this->path.$file)); |
|
| 99 | + if(is_file($this->path.$file) && $file!="." && $file!="..") { |
|
| 100 | + $cache_date= max($cache_date, filemtime($this->path.$file)); |
|
| 101 | + } |
|
| 98 | 102 | } |
| 99 | 103 | closedir($dir); |
| 100 | 104 | } |
@@ -106,8 +110,9 @@ discard block |
||
| 106 | 110 | { |
| 107 | 111 | if ($file !== "." && $file !== "..") |
| 108 | 112 | { |
| 109 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 110 | - $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 113 | + if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) { |
|
| 114 | + $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 115 | + } |
|
| 111 | 116 | } |
| 112 | 117 | } |
| 113 | 118 | closedir($dir); |
@@ -123,8 +128,7 @@ discard block |
||
| 123 | 128 | header("Last-modified: ".$last_modified); |
| 124 | 129 | header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
| 125 | 130 | header("Pragma:"); // Tells HTTP 1.0 clients to cache |
| 126 | - } |
|
| 127 | - else |
|
| 131 | + } else |
|
| 128 | 132 | { |
| 129 | 133 | header("Last-modified: ".$last_modified); |
| 130 | 134 | header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
@@ -207,8 +211,9 @@ discard block |
||
| 207 | 211 | { |
| 208 | 212 | if ($file !== "." && $file !== "..") |
| 209 | 213 | { |
| 210 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 211 | - $sub_scripts_list[]= "plugins/".$file."/".$file.".js"; |
|
| 214 | + if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) { |
|
| 215 | + $sub_scripts_list[]= "plugins/".$file."/".$file.".js"; |
|
| 216 | + } |
|
| 212 | 217 | } |
| 213 | 218 | } |
| 214 | 219 | closedir($dir); |
@@ -247,22 +252,23 @@ discard block |
||
| 247 | 252 | 'Î' => '"', |
| 248 | 253 | 'Ï' => "\n", |
| 249 | 254 | 'À' => "\r"*/); |
| 250 | - } |
|
| 251 | - else |
|
| 255 | + } else |
|
| 252 | 256 | { |
| 253 | 257 | $last_comp = array(); |
| 254 | 258 | } |
| 255 | 259 | |
| 256 | 260 | $js_replace= ''; |
| 257 | - foreach( $last_comp as $key => $val ) |
|
| 258 | - $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; |
|
| 261 | + foreach( $last_comp as $key => $val ) { |
|
| 262 | + $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; |
|
| 263 | + } |
|
| 259 | 264 | |
| 260 | 265 | $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n", |
| 261 | 266 | str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ), |
| 262 | 267 | $js_replace); |
| 263 | 268 | |
| 264 | - if($this->load_all_plugins) |
|
| 265 | - $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 269 | + if($this->load_all_plugins) { |
|
| 270 | + $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 271 | + } |
|
| 266 | 272 | |
| 267 | 273 | |
| 268 | 274 | // load the template |
@@ -283,7 +289,7 @@ discard block |
||
| 283 | 289 | $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
| 284 | 290 | $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas)); |
| 285 | 291 | $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0); |
| 286 | - }else{ |
|
| 292 | + } else{ |
|
| 287 | 293 | $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0); |
| 288 | 294 | } |
| 289 | 295 | $header.=sprintf(", reduced by %s%%\n", $ratio); |
@@ -296,19 +302,22 @@ discard block |
||
| 296 | 302 | // generate gzip file and cahce it if using disk cache |
| 297 | 303 | if($this->use_gzip){ |
| 298 | 304 | $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
| 299 | - if($this->param['use_disk_cache']) |
|
| 300 | - $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); |
|
| 305 | + if($this->param['use_disk_cache']) { |
|
| 306 | + $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); |
|
| 307 | + } |
|
| 301 | 308 | } |
| 302 | 309 | |
| 303 | 310 | // generate full js file and cache it if using disk cache |
| 304 | - if($this->param['use_disk_cache']) |
|
| 305 | - $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); |
|
| 311 | + if($this->param['use_disk_cache']) { |
|
| 312 | + $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); |
|
| 313 | + } |
|
| 306 | 314 | |
| 307 | 315 | // generate output |
| 308 | - if($this->use_gzip) |
|
| 309 | - echo $this->gzip_datas; |
|
| 310 | - else |
|
| 311 | - echo $this->datas; |
|
| 316 | + if($this->use_gzip) { |
|
| 317 | + echo $this->gzip_datas; |
|
| 318 | + } else { |
|
| 319 | + echo $this->datas; |
|
| 320 | + } |
|
| 312 | 321 | |
| 313 | 322 | // die; |
| 314 | 323 | } |
@@ -325,7 +334,7 @@ discard block |
||
| 325 | 334 | fclose($fd); |
| 326 | 335 | return $content;*/ |
| 327 | 336 | return $this->file_get_contents($file); |
| 328 | - }else{ |
|
| 337 | + } else{ |
|
| 329 | 338 | $this->infos[]=sprintf("'%s' not loaded", $end_uri); |
| 330 | 339 | return ""; |
| 331 | 340 | } |
@@ -382,10 +391,11 @@ discard block |
||
| 382 | 391 | /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
| 383 | 392 | $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/ |
| 384 | 393 | $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
| 385 | - if($this->param['compress']) |
|
| 386 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); |
|
| 387 | - else |
|
| 388 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); |
|
| 394 | + if($this->param['compress']) { |
|
| 395 | + $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); |
|
| 396 | + } else { |
|
| 397 | + $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); |
|
| 398 | + } |
|
| 389 | 399 | $str= preg_replace($pattern, $replace, $str); |
| 390 | 400 | } |
| 391 | 401 | |
@@ -407,8 +417,9 @@ discard block |
||
| 407 | 417 | |
| 408 | 418 | function file_put_contents($file, &$content, $mtime=-1) |
| 409 | 419 | { |
| 410 | - if($mtime==-1) |
|
| 411 | - $mtime=time(); |
|
| 420 | + if($mtime==-1) { |
|
| 421 | + $mtime=time(); |
|
| 422 | + } |
|
| 412 | 423 | $fp = @fopen($file, "wb"); |
| 413 | 424 | if ($fp) { |
| 414 | 425 | fwrite($fp, $content); |
@@ -235,5 +235,5 @@ |
||
| 235 | 235 | 'please_complete_the_form' =>'Completa il form !', |
| 236 | 236 | 'this_field_is_required' =>'Questo campo è obbligatorio', |
| 237 | 237 | 'text_form' => 'Form', |
| 238 | - "your_file_extension_is_not_allowed "=>"Estensione file non permessa!", |
|
| 238 | + "your_file_extension_is_not_allowed "=>"Estensione file non permessa!", |
|
| 239 | 239 | ]; |
@@ -224,8 +224,8 @@ |
||
| 224 | 224 | 'datamodal_select'=>'Select', |
| 225 | 225 | 'datamodal_search_and_enter'=>'Cerca e premi invio...', |
| 226 | 226 | 'datamodal_enter_to_search'=>'premi invio per cercare', |
| 227 | - 'datamodal_browse_data'=>'Esplora dati' , |
|
| 228 | - 'datamodal_browse_file'=>'Esplora file' , |
|
| 227 | + 'datamodal_browse_data'=>'Esplora dati', |
|
| 228 | + 'datamodal_browse_file'=>'Esplora file', |
|
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | //child |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | 'email_setting' => 'Configurações de E-mail', |
| 162 | 162 | 'application_setting' => 'Configurações do Aplicativo', |
| 163 | 163 | |
| 164 | - // table filter & sort |
|
| 164 | + // table filter & sort |
|
| 165 | 165 | 'filter_select_operator_type' => 'Selecione o operador', |
| 166 | 166 | 'filter_ascending' => 'ASCENDENTE', |
| 167 | 167 | 'filter_descending' => 'DESCENDENTE', |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | 'confirmation_text' => 'Tem certeza de que quer fazer isso?', |
| 199 | 199 | 'confirmButtonText' => 'Sim', |
| 200 | 200 | |
| 201 | - //datamodal |
|
| 201 | + //datamodal |
|
| 202 | 202 | 'datamodal_select'=>'Select', |
| 203 | 203 | 'datamodal_search_and_enter'=>'Search and enter...', |
| 204 | 204 | 'datamodal_enter_to_search'=>'Enter to search', |
@@ -213,5 +213,5 @@ discard block |
||
| 213 | 213 | 'please_complete_the_form' =>'Please complete the form !', |
| 214 | 214 | 'this_field_is_required' =>'This field is required', |
| 215 | 215 | 'text_form' => 'Form', |
| 216 | - "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 216 | + "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 217 | 217 | ]; |
@@ -202,8 +202,8 @@ |
||
| 202 | 202 | 'datamodal_select'=>'Select', |
| 203 | 203 | 'datamodal_search_and_enter'=>'Search and enter...', |
| 204 | 204 | 'datamodal_enter_to_search'=>'Enter to search', |
| 205 | - 'datamodal_browse_data'=>'Browse Data' , |
|
| 206 | - 'datamodal_browse_file'=>'Browse File' , |
|
| 205 | + 'datamodal_browse_data'=>'Browse Data', |
|
| 206 | + 'datamodal_browse_file'=>'Browse File', |
|
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | //child |
@@ -233,5 +233,5 @@ |
||
| 233 | 233 | 'please_complete_the_form' =>'Παρακαλώ συμπληρώστε την φόρμα!', |
| 234 | 234 | 'this_field_is_required' =>'Αυτό το πεδίο απαιτείται', |
| 235 | 235 | 'text_form' => 'Φόρμα', |
| 236 | - "your_file_extension_is_not_allowed "=>"Αυτό το είδος αρχείου δεν επιτρέπεται!", |
|
| 236 | + "your_file_extension_is_not_allowed "=>"Αυτό το είδος αρχείου δεν επιτρέπεται!", |
|
| 237 | 237 | ]; |
@@ -222,8 +222,8 @@ |
||
| 222 | 222 | 'datamodal_select'=>'Επιλογή', |
| 223 | 223 | 'datamodal_search_and_enter'=>'Αναζήτηση και enter...', |
| 224 | 224 | 'datamodal_enter_to_search'=>'Εισαγωγή προς αναζήτηση', |
| 225 | - 'datamodal_browse_data'=>'Εξερεύνηση δεδομένων' , |
|
| 226 | - 'datamodal_browse_file'=>'Εξερεύνηση αρχείων' , |
|
| 225 | + 'datamodal_browse_data'=>'Εξερεύνηση δεδομένων', |
|
| 226 | + 'datamodal_browse_file'=>'Εξερεύνηση αρχείων', |
|
| 227 | 227 | |
| 228 | 228 | |
| 229 | 229 | //child |
@@ -219,6 +219,6 @@ |
||
| 219 | 219 | 'datamodal_select'=>'选择', |
| 220 | 220 | 'datamodal_search_and_enter'=>'查询并进入...', |
| 221 | 221 | 'datamodal_enter_to_search'=>'进入查询', |
| 222 | - 'datamodal_browse_data'=>'浏览数据' , |
|
| 222 | + 'datamodal_browse_data'=>'浏览数据', |
|
| 223 | 223 | |
| 224 | 224 | ]; |
@@ -233,5 +233,5 @@ |
||
| 233 | 233 | 'please_complete_the_form' =>'Please complete the form !', |
| 234 | 234 | 'this_field_is_required' =>'This field is required', |
| 235 | 235 | 'text_form' => 'Form', |
| 236 | - "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 236 | + "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 237 | 237 | ]; |
@@ -222,8 +222,8 @@ |
||
| 222 | 222 | 'datamodal_select'=>'Select', |
| 223 | 223 | 'datamodal_search_and_enter'=>'Search and enter...', |
| 224 | 224 | 'datamodal_enter_to_search'=>'Enter to search', |
| 225 | - 'datamodal_browse_data'=>'Browse Data' , |
|
| 226 | - 'datamodal_browse_file'=>'Browse File' , |
|
| 225 | + 'datamodal_browse_data'=>'Browse Data', |
|
| 226 | + 'datamodal_browse_file'=>'Browse File', |
|
| 227 | 227 | |
| 228 | 228 | |
| 229 | 229 | //child |
@@ -215,7 +215,7 @@ |
||
| 215 | 215 | 'confirmation_text' => 'Bu işlemi yapmak istediğinizden emin misiniz?', |
| 216 | 216 | 'confirmButtonText' => 'Evet', |
| 217 | 217 | |
| 218 | - //datamodal |
|
| 218 | + //datamodal |
|
| 219 | 219 | 'datamodal_select' =>'Seç', |
| 220 | 220 | 'datamodal_search_and_enter' =>'Aramak için yazın ve enter tuşuna basın..', |
| 221 | 221 | 'datamodal_enter_to_search' =>'Aramak için Enter tuşuna basınız', |
@@ -219,8 +219,8 @@ |
||
| 219 | 219 | 'datamodal_select' =>'Seç', |
| 220 | 220 | 'datamodal_search_and_enter' =>'Aramak için yazın ve enter tuşuna basın..', |
| 221 | 221 | 'datamodal_enter_to_search' =>'Aramak için Enter tuşuna basınız', |
| 222 | - 'datamodal_browse_data' =>'Gözat' , |
|
| 223 | - 'datamodal_browse_file' =>'Dosyaya Gözat' , |
|
| 222 | + 'datamodal_browse_data' =>'Gözat', |
|
| 223 | + 'datamodal_browse_file' =>'Dosyaya Gözat', |
|
| 224 | 224 | |
| 225 | 225 | //child |
| 226 | 226 | 'table_detail' =>'Tablo ', |
@@ -1,123 +1,123 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | return [ |
| 3 | - 'emaill_footer' =>'No respondas a este mensaje, es un mensaje generado automáticamente.', |
|
| 4 | - 'login_message' =>'Por favor, inicia sesión para comenzar', |
|
| 5 | - 'text_forgot_password' =>'¿Olvidaste tu contraseña?', |
|
| 6 | - 'page_title_login' =>'Inicio de sesión', |
|
| 7 | - 'page_title_forgot' =>'Recuperar contraseña', |
|
| 8 | - 'forgot_message' =>'Introduce tu dirección de correo electrónico para enviarte tu nueva contraseña', |
|
| 9 | - "forgot_text_try_again" =>"¿Volver a iniciar sesión?", |
|
| 10 | - 'text_no_notification' =>"No tienes notificaciones", |
|
| 11 | - 'text_view_all_notification' =>'Ver todas', |
|
| 12 | - 'label_button_profile' =>"Perfil", |
|
| 13 | - 'filter_dialog_title' =>'Filtros y búsquedas avanzadas', |
|
| 14 | - 'text_enter_the_password' =>'Introduce la contraseña para volver a la sesión', |
|
| 15 | - 'text_or_sign_in' =>'O inicia sesión con otro usuario', |
|
| 16 | - 'text_default_add_new_module' =>'Añadir nuevo :module', |
|
| 17 | - 'text_default_list_module' =>'Ver :module', |
|
| 18 | - 'text_default_help_password' =>'Mínimo 5 caracteres. Deja este campo vacio si no solicitaste un cambio de contraseña.', |
|
| 19 | - 'text_default_help_upload' =>'Tipo de imágenes soportados: JPG, JPEG, PNG, GIF, BMP', |
|
| 20 | - 'text_default_help_number' =>'Puedes introducir solo un número', |
|
| 21 | - 'text_default_help_email' =>'Introduce una dirección de correo electrónico válida', |
|
| 22 | - 'text_default_help_text' =>'Puedes introducir solo una letra', |
|
| 23 | - 'text_default_help_url' =>'Introduce una dirección web (URL) válida', |
|
| 24 | - 'text_dashboard' =>'Escritorio', |
|
| 25 | - 'text_prefix_option' =>'** Selecciona un', |
|
| 26 | - 'text_loading' =>'Espera un segundo, por favor. Cargando...', |
|
| 27 | - 'message_after_logout' =>'¡Gracias por la visita, nos vemos pronto!', |
|
| 28 | - 'message_forgot_password' =>'Te hemos enviado una nueva contraseña. Revisa tu correo electrónico. ¡Puede estar en la carpeta de spam!', |
|
| 29 | - 'page_not_found'=>'Vaya, esta página no existe o no tienes acceso.', |
|
| 30 | - 'page_not_found_text'=>'No encontramos la página que nos pides.', |
|
| 3 | + 'emaill_footer' =>'No respondas a este mensaje, es un mensaje generado automáticamente.', |
|
| 4 | + 'login_message' =>'Por favor, inicia sesión para comenzar', |
|
| 5 | + 'text_forgot_password' =>'¿Olvidaste tu contraseña?', |
|
| 6 | + 'page_title_login' =>'Inicio de sesión', |
|
| 7 | + 'page_title_forgot' =>'Recuperar contraseña', |
|
| 8 | + 'forgot_message' =>'Introduce tu dirección de correo electrónico para enviarte tu nueva contraseña', |
|
| 9 | + "forgot_text_try_again" =>"¿Volver a iniciar sesión?", |
|
| 10 | + 'text_no_notification' =>"No tienes notificaciones", |
|
| 11 | + 'text_view_all_notification' =>'Ver todas', |
|
| 12 | + 'label_button_profile' =>"Perfil", |
|
| 13 | + 'filter_dialog_title' =>'Filtros y búsquedas avanzadas', |
|
| 14 | + 'text_enter_the_password' =>'Introduce la contraseña para volver a la sesión', |
|
| 15 | + 'text_or_sign_in' =>'O inicia sesión con otro usuario', |
|
| 16 | + 'text_default_add_new_module' =>'Añadir nuevo :module', |
|
| 17 | + 'text_default_list_module' =>'Ver :module', |
|
| 18 | + 'text_default_help_password' =>'Mínimo 5 caracteres. Deja este campo vacio si no solicitaste un cambio de contraseña.', |
|
| 19 | + 'text_default_help_upload' =>'Tipo de imágenes soportados: JPG, JPEG, PNG, GIF, BMP', |
|
| 20 | + 'text_default_help_number' =>'Puedes introducir solo un número', |
|
| 21 | + 'text_default_help_email' =>'Introduce una dirección de correo electrónico válida', |
|
| 22 | + 'text_default_help_text' =>'Puedes introducir solo una letra', |
|
| 23 | + 'text_default_help_url' =>'Introduce una dirección web (URL) válida', |
|
| 24 | + 'text_dashboard' =>'Escritorio', |
|
| 25 | + 'text_prefix_option' =>'** Selecciona un', |
|
| 26 | + 'text_loading' =>'Espera un segundo, por favor. Cargando...', |
|
| 27 | + 'message_after_logout' =>'¡Gracias por la visita, nos vemos pronto!', |
|
| 28 | + 'message_forgot_password' =>'Te hemos enviado una nueva contraseña. Revisa tu correo electrónico. ¡Puede estar en la carpeta de spam!', |
|
| 29 | + 'page_not_found'=>'Vaya, esta página no existe o no tienes acceso.', |
|
| 30 | + 'page_not_found_text'=>'No encontramos la página que nos pides.', |
|
| 31 | 31 | |
| 32 | - 'page_not_found_tips'=>'* Asegúrate que la dirección es la correcta<br/> |
|
| 32 | + 'page_not_found_tips'=>'* Asegúrate que la dirección es la correcta<br/> |
|
| 33 | 33 | * Recuerda que el sistema distingue entre mayúsculas y minúsculas<br/> |
| 34 | 34 | * Consulta con el administrador, puede que haya eliminado esta página<br/> |
| 35 | 35 | * Puedes regresar a la página anterior haciendo click en la flecha hacia atras del navegador<br/>', |
| 36 | 36 | |
| 37 | - 'alert_delete_selected' =>'¿Seguro que quieres eliminar todos los elementos seleccionados?', |
|
| 38 | - 'alert_delete_selected_success' =>'¡El borrado de los elementos seleccionados se ha completado con éxito!', |
|
| 39 | - 'alert_action' =>'¡Has :action con éxito!', |
|
| 40 | - 'alert_add_data_success' =>'¡Los datos han sido añadidos!', |
|
| 41 | - 'alert_add_data_failed' =>'¡Algo ha fallado al grabar los datos!', |
|
| 42 | - 'alert_update_data_success' =>'¡Los datos han sido actualizados con éxito!', |
|
| 43 | - 'alert_update_data_failed' =>'Algo ha fallado al actualizar los datos', |
|
| 44 | - 'alert_delete_data_success' =>'¡Borrado de datos con éxito!', |
|
| 45 | - 'alert_want_to_logout' =>'¿Quieres finalizar la sesión?', |
|
| 46 | - 'alert_warning' =>"¡Upss!", |
|
| 47 | - 'alert_danger' =>'Parece que algo no funciona...', |
|
| 48 | - 'alert_success' =>'Hecho, buen trabajo...', |
|
| 49 | - 'alert_info' =>'Información', |
|
| 50 | - 'alert_primary' =>'Información', |
|
| 51 | - 'alert_session_expired' =>'Has superado el tiempo máximo de sesión, Inicia sesión de nuevo. Gracias !', |
|
| 52 | - 'alert_password_wrong' =>'Lo sentimos, la contraseña esta mal escrita !', |
|
| 53 | - 'alert_required' =>'Asegurate que has rellenado todos los campos obligatorios', |
|
| 54 | - 'alert_error_ajax' =>'Parece que tenemos problemas en el sistema, vamos a intentar corregirlo lo antes posible !', |
|
| 55 | - 'alert_validation_error' =>'Rellena el formulario correctamente : :error', |
|
| 37 | + 'alert_delete_selected' =>'¿Seguro que quieres eliminar todos los elementos seleccionados?', |
|
| 38 | + 'alert_delete_selected_success' =>'¡El borrado de los elementos seleccionados se ha completado con éxito!', |
|
| 39 | + 'alert_action' =>'¡Has :action con éxito!', |
|
| 40 | + 'alert_add_data_success' =>'¡Los datos han sido añadidos!', |
|
| 41 | + 'alert_add_data_failed' =>'¡Algo ha fallado al grabar los datos!', |
|
| 42 | + 'alert_update_data_success' =>'¡Los datos han sido actualizados con éxito!', |
|
| 43 | + 'alert_update_data_failed' =>'Algo ha fallado al actualizar los datos', |
|
| 44 | + 'alert_delete_data_success' =>'¡Borrado de datos con éxito!', |
|
| 45 | + 'alert_want_to_logout' =>'¿Quieres finalizar la sesión?', |
|
| 46 | + 'alert_warning' =>"¡Upss!", |
|
| 47 | + 'alert_danger' =>'Parece que algo no funciona...', |
|
| 48 | + 'alert_success' =>'Hecho, buen trabajo...', |
|
| 49 | + 'alert_info' =>'Información', |
|
| 50 | + 'alert_primary' =>'Información', |
|
| 51 | + 'alert_session_expired' =>'Has superado el tiempo máximo de sesión, Inicia sesión de nuevo. Gracias !', |
|
| 52 | + 'alert_password_wrong' =>'Lo sentimos, la contraseña esta mal escrita !', |
|
| 53 | + 'alert_required' =>'Asegurate que has rellenado todos los campos obligatorios', |
|
| 54 | + 'alert_error_ajax' =>'Parece que tenemos problemas en el sistema, vamos a intentar corregirlo lo antes posible !', |
|
| 55 | + 'alert_validation_error' =>'Rellena el formulario correctamente : :error', |
|
| 56 | 56 | |
| 57 | - 'add_data_page_title' => 'Añadir :module', |
|
| 58 | - 'edit_data_page_title' => 'Editar :module', 'button_add_to_table' =>'Agregar a la Tabla', |
|
| 57 | + 'add_data_page_title' => 'Añadir :module', |
|
| 58 | + 'edit_data_page_title' => 'Editar :module', 'button_add_to_table' =>'Agregar a la Tabla', |
|
| 59 | 59 | |
| 60 | - 'detail_data_page_title' => 'Detalles :module', |
|
| 60 | + 'detail_data_page_title' => 'Detalles :module', |
|
| 61 | 61 | |
| 62 | - 'default_module_description'=>'Listado', |
|
| 62 | + 'default_module_description'=>'Listado', |
|
| 63 | 63 | |
| 64 | - 'delete_description_confirm' =>"No podrás recuperar estos datos!", |
|
| 65 | - 'delete_title_confirm' =>"Estás Seguro?", |
|
| 64 | + 'delete_description_confirm' =>"No podrás recuperar estos datos!", |
|
| 65 | + 'delete_title_confirm' =>"Estás Seguro?", |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | - 'action_show_data' =>'Mostrar', |
|
| 69 | - 'action_add_data' =>'Añadir', |
|
| 70 | - 'action_delete_selected' =>'Elimina los seleccionados', |
|
| 68 | + 'action_show_data' =>'Mostrar', |
|
| 69 | + 'action_add_data' =>'Añadir', |
|
| 70 | + 'action_delete_selected' =>'Elimina los seleccionados', |
|
| 71 | 71 | |
| 72 | - 'action_label' =>'Acción', |
|
| 73 | - 'action_detail_data' =>'Detalles', |
|
| 74 | - 'action_edit_data' =>'Editar', |
|
| 75 | - 'action_delete_data' =>'Eliminar', |
|
| 72 | + 'action_label' =>'Acción', |
|
| 73 | + 'action_detail_data' =>'Detalles', |
|
| 74 | + 'action_edit_data' =>'Editar', |
|
| 75 | + 'action_delete_data' =>'Eliminar', |
|
| 76 | 76 | |
| 77 | - 'button_cancel' =>'Cancelar', |
|
| 78 | - 'button_add' =>'Añadir', |
|
| 79 | - 'button_edit' =>'Editar', |
|
| 80 | - 'button_back' =>'Volver', |
|
| 81 | - 'button_save' =>'Guardar', |
|
| 82 | - 'button_save_more' =>'Guardar y Añadir otro', |
|
| 83 | - 'button_import' =>'Importar', |
|
| 84 | - 'button_export' =>'Exportar', |
|
| 85 | - 'button_filter' =>'Filtros y Orden', |
|
| 86 | - 'button_close' =>'Cerrar', |
|
| 87 | - 'button_submit' =>'Enviar', |
|
| 88 | - 'button_logout' =>'Salir', |
|
| 89 | - 'button_sign_in' =>'Iniciar', |
|
| 90 | - 'button_selected_action' =>'Acciones Masivas', |
|
| 91 | - 'button_download_file' =>'Descargar Fichero', |
|
| 92 | - 'button_reset' =>'Resetear', |
|
| 93 | - 'button_add_to_table' =>'Agregar a la Tabla', |
|
| 77 | + 'button_cancel' =>'Cancelar', |
|
| 78 | + 'button_add' =>'Añadir', |
|
| 79 | + 'button_edit' =>'Editar', |
|
| 80 | + 'button_back' =>'Volver', |
|
| 81 | + 'button_save' =>'Guardar', |
|
| 82 | + 'button_save_more' =>'Guardar y Añadir otro', |
|
| 83 | + 'button_import' =>'Importar', |
|
| 84 | + 'button_export' =>'Exportar', |
|
| 85 | + 'button_filter' =>'Filtros y Orden', |
|
| 86 | + 'button_close' =>'Cerrar', |
|
| 87 | + 'button_submit' =>'Enviar', |
|
| 88 | + 'button_logout' =>'Salir', |
|
| 89 | + 'button_sign_in' =>'Iniciar', |
|
| 90 | + 'button_selected_action' =>'Acciones Masivas', |
|
| 91 | + 'button_download_file' =>'Descargar Fichero', |
|
| 92 | + 'button_reset' =>'Resetear', |
|
| 93 | + 'button_add_to_table' =>'Agregar a la Tabla', |
|
| 94 | 94 | |
| 95 | 95 | |
| 96 | - 'export_dialog_title' =>"Exportar Datos", |
|
| 97 | - 'export_dialog_filename' =>'Nombre Fichero', |
|
| 98 | - 'export_dialog_help_filename' =>'Puedes renombrar el fichero como desees', |
|
| 99 | - 'export_dialog_maxdata' =>"Max Data", |
|
| 100 | - 'export_dialog_help_maxdata' =>'Mínimo 1 y máximo 100,000 registros por sesión', |
|
| 101 | - 'export_dialog_columns' =>'Columnas', |
|
| 102 | - 'export_dialog_format_export' =>'Formato Exportación', |
|
| 103 | - 'export_dialog_show_advanced' =>'Muestra Exportaciones avanzadas', |
|
| 104 | - 'export_dialog_page_size' =>'Tamaño de Página', |
|
| 105 | - 'export_dialog_set_default' =>'Utilizar como tamaño por defecto', |
|
| 106 | - 'export_dialog_page_orientation' =>'Orientación', |
|
| 96 | + 'export_dialog_title' =>"Exportar Datos", |
|
| 97 | + 'export_dialog_filename' =>'Nombre Fichero', |
|
| 98 | + 'export_dialog_help_filename' =>'Puedes renombrar el fichero como desees', |
|
| 99 | + 'export_dialog_maxdata' =>"Max Data", |
|
| 100 | + 'export_dialog_help_maxdata' =>'Mínimo 1 y máximo 100,000 registros por sesión', |
|
| 101 | + 'export_dialog_columns' =>'Columnas', |
|
| 102 | + 'export_dialog_format_export' =>'Formato Exportación', |
|
| 103 | + 'export_dialog_show_advanced' =>'Muestra Exportaciones avanzadas', |
|
| 104 | + 'export_dialog_page_size' =>'Tamaño de Página', |
|
| 105 | + 'export_dialog_set_default' =>'Utilizar como tamaño por defecto', |
|
| 106 | + 'export_dialog_page_orientation' =>'Orientación', |
|
| 107 | 107 | |
| 108 | - 'import_page_title' =>'Importar :module', |
|
| 109 | - 'dashboard_default_text' =>'Bienvenido a :appname', |
|
| 110 | - 'form_back_to_list' =>'Volver al listado :module', |
|
| 111 | - 'not_logged_in' =>'No has iniciado sesión !', |
|
| 112 | - 'menu_navigation' =>"Navegación", |
|
| 113 | - 'table_data_not_found' =>"No tenemos datos disponibles", |
|
| 114 | - "notice_delete_file_upload" =>"* Si quieres subir otro fichero, antes elimina el fichero origen.", |
|
| 115 | - "file_broken" =>"Parece que no se ha subido bien el fichero. Elimínalo y vuelve a intentarlo.", |
|
| 116 | - 'denied_access'=>'¡Vaya, no tienes permisos para acceder a este area!', |
|
| 117 | - 'denied_update'=>'¡Vaya, no tienes permisos para actualizar datos!', |
|
| 118 | - 'denied_create'=>'¡Vaya, no tienes permisos para añadir datos!', |
|
| 119 | - 'denied_delete'=>'¡Vaya, no tienes permisos para eliminar datos!', |
|
| 120 | - 'user_image' => 'Imagen de usuario', |
|
| 108 | + 'import_page_title' =>'Importar :module', |
|
| 109 | + 'dashboard_default_text' =>'Bienvenido a :appname', |
|
| 110 | + 'form_back_to_list' =>'Volver al listado :module', |
|
| 111 | + 'not_logged_in' =>'No has iniciado sesión !', |
|
| 112 | + 'menu_navigation' =>"Navegación", |
|
| 113 | + 'table_data_not_found' =>"No tenemos datos disponibles", |
|
| 114 | + "notice_delete_file_upload" =>"* Si quieres subir otro fichero, antes elimina el fichero origen.", |
|
| 115 | + "file_broken" =>"Parece que no se ha subido bien el fichero. Elimínalo y vuelve a intentarlo.", |
|
| 116 | + 'denied_access'=>'¡Vaya, no tienes permisos para acceder a este area!', |
|
| 117 | + 'denied_update'=>'¡Vaya, no tienes permisos para actualizar datos!', |
|
| 118 | + 'denied_create'=>'¡Vaya, no tienes permisos para añadir datos!', |
|
| 119 | + 'denied_delete'=>'¡Vaya, no tienes permisos para eliminar datos!', |
|
| 120 | + 'user_image' => 'Imagen de usuario', |
|
| 121 | 121 | 'online' => 'En línea', |
| 122 | 122 | 'controller_route_404' => 'Controlador o Ruta no encontrado(a).', |
| 123 | 123 | 'home' => 'Principal', |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | 'chose_an_image' => 'Elige una imagen ', |
| 197 | 197 | 'chose_an_file' => 'Elige un fichero ', |
| 198 | 198 | |
| 199 | - //datamodal |
|
| 199 | + //datamodal |
|
| 200 | 200 | |
| 201 | 201 | 'datamodal_select'=>'Seleccionar', |
| 202 | 202 | 'datamodal_search_and_enter'=>'Buscar y enter...', |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | 'datamodal_enter_to_search'=>'Enter to search', |
| 209 | 209 | 'datamodal_browse_data'=>'Browse Data' , |
| 210 | 210 | |
| 211 | - //action confirmation |
|
| 211 | + //action confirmation |
|
| 212 | 212 | 'confirmation_title' => 'Confirmación', |
| 213 | 213 | 'confirmation_text' => '¿Está seguro que desea realizar esta acción?', |
| 214 | 214 | |
@@ -222,5 +222,5 @@ discard block |
||
| 222 | 222 | 'please_complete_the_form' =>'Please complete the form !', |
| 223 | 223 | 'this_field_is_required' =>'This field is required', |
| 224 | 224 | 'text_form' => 'Form', |
| 225 | - "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 225 | + "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 226 | 226 | ]; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | 'alert_validation_error' =>'Rellena el formulario correctamente : :error', |
| 56 | 56 | |
| 57 | 57 | 'add_data_page_title' => 'Añadir :module', |
| 58 | - 'edit_data_page_title' => 'Editar :module', 'button_add_to_table' =>'Agregar a la Tabla', |
|
| 58 | + 'edit_data_page_title' => 'Editar :module', 'button_add_to_table' =>'Agregar a la Tabla', |
|
| 59 | 59 | |
| 60 | 60 | 'detail_data_page_title' => 'Detalles :module', |
| 61 | 61 | |
@@ -201,18 +201,18 @@ discard block |
||
| 201 | 201 | 'datamodal_select'=>'Seleccionar', |
| 202 | 202 | 'datamodal_search_and_enter'=>'Buscar y enter...', |
| 203 | 203 | 'datamodal_enter_to_search'=>'Enter para buscar', |
| 204 | - 'datamodal_browse_data'=>'Escojer Dato' , |
|
| 204 | + 'datamodal_browse_data'=>'Escojer Dato', |
|
| 205 | 205 | |
| 206 | 206 | 'datamodal_select'=>'Select', |
| 207 | 207 | 'datamodal_search_and_enter'=>'Search and enter...', |
| 208 | 208 | 'datamodal_enter_to_search'=>'Enter to search', |
| 209 | - 'datamodal_browse_data'=>'Browse Data' , |
|
| 209 | + 'datamodal_browse_data'=>'Browse Data', |
|
| 210 | 210 | |
| 211 | 211 | //action confirmation |
| 212 | 212 | 'confirmation_title' => 'Confirmación', |
| 213 | 213 | 'confirmation_text' => '¿Está seguro que desea realizar esta acción?', |
| 214 | 214 | |
| 215 | - 'datamodal_browse_file'=>'Browse File' , |
|
| 215 | + 'datamodal_browse_file'=>'Browse File', |
|
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | //child |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | 'chose_an_image' => 'اختر صورة ', |
| 208 | 208 | 'chose_an_file' => 'اختر ملف ', |
| 209 | 209 | |
| 210 | - //datamodal |
|
| 210 | + //datamodal |
|
| 211 | 211 | 'datamodal_select'=>'Select', |
| 212 | 212 | 'datamodal_search_and_enter'=>'Search and enter...', |
| 213 | 213 | 'datamodal_enter_to_search'=>'Enter to search', |
@@ -222,5 +222,5 @@ discard block |
||
| 222 | 222 | 'please_complete_the_form' =>'Please complete the form !', |
| 223 | 223 | 'this_field_is_required' =>'This field is required', |
| 224 | 224 | 'text_form' => 'Form', |
| 225 | - "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 225 | + "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
| 226 | 226 | ]; |
@@ -202,8 +202,8 @@ |
||
| 202 | 202 | 'datamodal_select'=>'Select', |
| 203 | 203 | 'datamodal_search_and_enter'=>'Search and enter...', |
| 204 | 204 | 'datamodal_enter_to_search'=>'Enter to search', |
| 205 | - 'datamodal_browse_data'=>'Browse Data' , |
|
| 206 | - 'datamodal_browse_file'=>'Browse File' , |
|
| 205 | + 'datamodal_browse_data'=>'Browse Data', |
|
| 206 | + 'datamodal_browse_file'=>'Browse File', |
|
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | //child |