}
protected function _correctFiles($dir) {
-
- $preloadFile = $d['dir'] . '/' . $this->_config['name'] . '_edgePreload.js';
- $preload = file_get_contents($preloadFile);
- $preload = str_replace('load:"', 'load:"data/links/' . $this->to . '/', $preload);
- file_put_contents($preloadFile, $preload);
+ $files = CubeIT_Files::getRecursiveDirectoryIterator($dir);
+ foreach ($files as $f) {
+ /* @var $f SplFileInfo */
+ if ($f->getExtension() == 'js') {
+ $this->_correctFile($f);
+ }
+ }
}
+ /**
+ *
+ * @param SplFileInfo $file
+ */
protected function _correctFile($file) {
+ $d = 'data/links/' . $this->to . '/';
$content = file_get_contents($file);
-
+ foreach ($this->_config['assets'] as $a) {
+ $content = str_replace($a, $d . $a, $content);
+ }
+ $content = str_replace("='images/';", "='$d"."images/';",$content);
file_put_contents($file, $content);
}