diff --git a/core/SSViewer.php b/core/SSViewer.php index 6678ac0cc..b9f34dca8 100644 --- a/core/SSViewer.php +++ b/core/SSViewer.php @@ -437,15 +437,19 @@ class SSViewer extends Object { // legacy $content = ereg_replace('', '<' . '% control \\1 %' . '>', $content); $content = ereg_replace('', '<' . '% end_control %' . '>', $content); - + + // < % control Foo % > $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+) +%' . '>', 'obj("\\1")) foreach($loop as $key => $item) { ?>', $content); + // < % control Foo.Bar % > $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\.([A-Za-z0-9_]+) +%' . '>', 'obj("\\1")) && ($loop = $loop->obj("\\2"))) foreach($loop as $key => $item) { ?>', $content); - - $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\.([A-Za-z0-9_]+)\\(([A-Za-z0-9_-]+)\\) +%' . '>', 'obj("\\1")) && ($loop = $loop->obj("\\2", array("\\3")))) foreach($loop as $key => $item) { ?>', $content); - - $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\(([A-Za-z0-9_-]+)\\) +%' . '>', 'obj("\\1", array("\\2"))) foreach($loop as $key => $item) { ?>', $content); - $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\(([A-Za-z0-9_-]+), *([A-Za-z0-9_-]+)\\) +%' . '>', 'obj("\\1", array("\\2","\\3"))) foreach($loop as $key => $item) { ?>', $content); - $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\(([A-Za-z0-9_-]+), *([A-Za-z0-9_-]+), *([A-Za-z0-9_-]+)\\) +%' . '>', 'obj("\\1", array("\\2", "\\3", "\\4"))) foreach($loop as $key => $item) { ?>', $content); + // < % control Foo.Bar(Baz) % > + $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\.([A-Za-z0-9_]+)\\(([^),]+)\\) +%' . '>', 'obj("\\1")) && ($loop = $loop->obj("\\2", array("\\3")))) foreach($loop as $key => $item) { ?>', $content); + // < % control Foo(Bar) % > + $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\(([^),]+)\\) +%' . '>', 'obj("\\1", array("\\2"))) foreach($loop as $key => $item) { ?>', $content); + // < % control Foo(Bar, Baz) % > + $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\(([^),]+), *([^),]+)\\) +%' . '>', 'obj("\\1", array("\\2","\\3"))) foreach($loop as $key => $item) { ?>', $content); + // < % control Foo(Bar, Baz, Buz) % > + $content = ereg_replace('<' . '% +control +([A-Za-z0-9_]+)\\(([^),]+), *([^),]+), *([^),]+)\\) +%' . '>', 'obj("\\1", array("\\2", "\\3", "\\4"))) foreach($loop as $key => $item) { ?>', $content); $content = ereg_replace('<' . '% +end_control +%' . '>', '', $content); $content = ereg_replace('<' . '% +debug +%' . '>', '', $content); $content = ereg_replace('<' . '% +debug +([A-Za-z0-9_]+) +%' . '>', 'cachedCall("\\1")) ?>', $content);