BUGFIX #4113: Fixed bugs with template processing in i18nTextCollectorTask.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@77733 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-25 04:28:35 +00:00
parent 8b3a9c685f
commit e72e9a6d88
2 changed files with 6 additions and 2 deletions

View File

@ -192,9 +192,12 @@ class i18nTextCollector extends Object {
$includeName = $reg[1];
$includeFileName = "{$includeName}.ss";
$filePath = SSViewer::getTemplateFileByType($includeName, 'Includes');
$includeContent = file_get_contents($filePath);
if(!$filePath) $filePath = SSViewer::getTemplateFileByType($includeName, 'main');
if($filePath) {
$includeContent = file_get_contents($filePath);
$entitiesArr = array_merge($entitiesArr,(array)$this->collectFromTemplate($includeContent, $module, $includeFileName));
}
// @todo Will get massively confused if you include the includer -> infinite loop
$entitiesArr = array_merge($entitiesArr,(array)$this->collectFromTemplate($includeContent, $module, $includeFileName));
}
// @todo respect template tags (< % _t() % > instead of _t())

View File

@ -25,6 +25,7 @@ class i18nTextCollectorTask extends BuildTask {
* @uses DataObject->collectI18nStatics()
*/
public function run($request) {
set_time_limit(0);
$c = new i18nTextCollector();
$restrictModules = ($request->getVar('module')) ? explode(',', $request->getVar('module')) : null;
return $c->run($restrictModules);