langs); $themes = array_keys($lang->themes); /* Create css files for every them and every lang. */ foreach($langs as $lang) { foreach($themes as $theme) { /* Common css files. */ $cssCode = file_get_contents($themeRoot . 'default/yui.css'); $cssCode .= file_get_contents($themeRoot . 'default/style.css'); $cssCode .= file_get_contents($themeRoot . 'default/colorbox.css'); $cssCode .= file_get_contents($themeRoot . 'default/chosen.css'); $cssCode .= file_get_contents($themeRoot . 'default/treeview.css'); $cssCode .= file_get_contents($themeRoot . 'default/datepicker.css'); $cssCode .= file_get_contents($themeRoot . 'default/alert.css'); /* Css file for current lang and current them. */ $cssCode .= file_get_contents($themeRoot . "lang/$lang.css"); if($theme != 'default') $cssCode .= file_get_contents($themeRoot . $theme . '/style.css'); /* Combine them. */ $cssFile = $themeRoot . "default/$lang.$theme.css"; file_put_contents($cssFile, $cssCode); /* Compress it. */ `java -jar ~/bin/yuicompressor/build/yuicompressor.jar --type css $cssFile -o $cssFile`; } }