From d58e4f32b226de6b8f2253c8d0b9cefef2b287b4 Mon Sep 17 00:00:00 2001 From: devjin Date: Fri, 2 Sep 2011 06:43:41 +0000 Subject: [PATCH] dynamic ruleset parsing git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8988 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/template/TemplateHandler.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index e6f80f7a9..77aa2edcd 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -220,7 +220,12 @@ $matches[1] = preg_replace('/'.$m[0].'/i', '', $matches[1]); $matches[2] = ''.$matches[2]; - if(preg_match('@(?:^|\.?/)(modules/[\w-]+)@', $this->path, $mm)) { + if (strpos($m[1],'@') !== false){ + $path = str_replace('@', '', $m[1]); + $validator = new Validator("./files/ruleset/{$path}.xml"); + $validator->setCacheDir('files/cache'); + $matches[1] = 'getJsPath().'") ?'.'>'.$matches[1]; + }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');