issue 369 when ruleset file modified, then ruleset js file must dynamic recreate

this bug fixed
document.controller.php file : indent changed


git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9495 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-10-05 09:00:37 +00:00
parent 0016c7963a
commit 5afc0b7587
3 changed files with 28 additions and 21 deletions

View file

@ -222,15 +222,13 @@
if (strpos($m[1],'@') !== false){
$path = str_replace('@', '', $m[1]);
$validator = new Validator("./files/ruleset/{$path}.xml");
$validator->setCacheDir('files/cache');
$matches[1] = '<?php Context::addJsFile("'.$validator->getJsPath().'") ?'.'>'.$matches[1];
$path = './files/ruleset/'.$path.'.xml';
}else if(preg_match('@(?:^|\.?/)(modules/[\w-]+)@', $this->path, $mm)) {
$module_path = $mm[1];
$validator = new Validator("{$module_path}/ruleset/{$m[1]}.xml");
$validator->setCacheDir('files/cache');
$matches[1] = '<?php Context::addJsFile("'.$validator->getJsPath().'") ?'.'>'.$matches[1];
$path = $module_path.'/ruleset/'.$m[1].'.xml';
}
//assign to addJsFile method for js dynamic recache
$matches[1] = '<?php Context::addJsFile("'.$path.'", false, "", 0, "head", true) ?'.'>'.$matches[1];
}
}