".$s_l."( position ".$chunks[0][$i][1].") at ".$name); $temp[$c_size]=array($temps[0],$temps[1],$chunks[0][$i][1],0); $c_size++; } else { if (!$temp[$ballans]) { echo "
";print_r($temp); die("Incorrect Injection layout,
ballans corrupted.
".$s_l."( position ".$chunks[0][$i][1].") at ".$name); return 0; } for ($ii=$c_size-1; $ii>=0; $ii--) if ($temp[$ii][3]==0) { $temp[$ii][3]=$chunks[0][$i][1]+strlen($chunks[0][$i][0]); break; } $ballans++; //end of chunk } } if ($ballans!=(sizeof($chunks[0])/2)) { die("Incorrect Injection layout,
ballans corrupted at ".$name); return 0; } $tokens=array(); foreach ($temp as $k=>$v){ $name=$v[0]; if (!$tokens[$name]) $tokens[$name]=array(); $tokens[$name][]=$v; } return $tokens; } function clearAreas($data,$tokens,$preserve){ foreach($tokens as $k=>$v){ if ($v && array_search($k,$preserve)===FALSE){ foreach($v as $kd=>$vd){ $size=$vd[3]-$vd[2]; $bik=str_repeat("#",$size); $data=substr($data,0,$vd[2]).$bik.substr($data,$vd[3]); } } } $data=preg_replace("|([#]{6,})|","",$data); return $data; } function process_request($files, $chunks, $skin, $yui=false){ global $js_header; $files=explode(";",$files); $chunks=explode(";",$chunks); array_push($chunks,"__pro_feature"); $js_list=array("./dhtmlxcommon.js"); $css_list=array(); $manifest = array("Skin: ".$skin); for ($i=0; $i2) array_push($components,$temp[1]); } $location=export_images(array_values(array_unique($components)),$skin); for ($i=0; $i < sizeof($components); $i++) { $temp_name="../".$components[$i]."/codebase/skins/".strtolower($components[$i])."_".$skin.".css"; if (file_exists($temp_name)) array_push($css_list,$temp_name); } $css_list=array_values(array_unique($css_list)); $js_code=""; $css_code=""; $jscore_code=""; array_push($manifest,"\n======== JS CODE ========="); for ($i=0; $i {$location}/temp2.js`; $js_code=file_get_contents($location."/temp2.js"); unlink($location."/temp.js"); unlink($location."/temp2.js"); } $css_code=preg_replace('/"/',"'",$css_code); $css_code=str_replace("../imgs","imgs/",$css_code); $css_code=str_replace("../../codebase/","",$css_code); if (!$yui){ $css_code=preg_replace("#\/\*([^\*]|\*[^\/])*\*\/#","",$css_code); $css_code=preg_replace('/[ \t]+/'," ",$css_code); $css_code=preg_replace("/\{[\r\n]+/","{",$css_code); $css_code=preg_replace("/;[\r\n]+/",";",$css_code); $css_code=preg_replace("/[\r\n]+/","\n",$css_code); $css_code=preg_replace("/\/\*.*\n/","",$css_code); //$css_code=preg_replace("/\n/","\";str+=\"",$css_code); //$css_code=preg_replace("/\n/","\\n",$css_code); $css_code=preg_replace("/\{ /","{",$css_code); $css_code=preg_replace("/[; ]+\}/","}",$css_code); }else{ file_put_contents($location."/temp.css",$css_code); `java -jar ./yui/yuicompressor-2.3.5/build/yuicompressor-2.3.5.jar {$location}/temp.css > {$location}/temp2.css`; $css_code=file_get_contents($location."/temp2.css"); unlink($location."/temp.css"); unlink($location."/temp2.css"); } file_put_contents($location."/dhtmlx.js",$js_header.$js_code.$jscore_code); file_put_contents($location."/dhtmlx.css",$css_code); file_put_contents($location."/manifest.txt",implode("\n",$manifest)); return $location; } ?>