mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Formatted code a little better, at Stig's request.
This commit is contained in:
parent
5800db0239
commit
7ea151789b
@ -352,13 +352,19 @@ class GridField extends FormField {
|
|||||||
// If the fragment still has a fragment definition in it, when we should defer this item until later.
|
// If the fragment still has a fragment definition in it, when we should defer this item until later.
|
||||||
if(preg_match('/\$DefineFragment\(([a-z0-9\-_]+)\)/i', $fragment, $matches)) {
|
if(preg_match('/\$DefineFragment\(([a-z0-9\-_]+)\)/i', $fragment, $matches)) {
|
||||||
// If we've already deferred this fragment, then we have a circular dependency
|
// If we've already deferred this fragment, then we have a circular dependency
|
||||||
if(isset($fragmentDeferred[$k]) && $fragmentDeferred[$k] > 5) throw new LogicException("GridField HTML fragment '$fragmentName' and '$matches[1]' appear to have a circular dependency.");
|
if(isset($fragmentDeferred[$k]) && $fragmentDeferred[$k] > 5) {
|
||||||
|
throw new LogicException("GridField HTML fragment '$fragmentName' and '$matches[1]' " .
|
||||||
|
"appear to have a circular dependency.");
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise we can push to the end of the content array
|
// Otherwise we can push to the end of the content array
|
||||||
unset($content[$k]);
|
unset($content[$k]);
|
||||||
$content[$k] = $v;
|
$content[$k] = $v;
|
||||||
if(!isset($fragmentDeferred[$k])) $fragmentDeferred[$k] = 1;
|
if(!isset($fragmentDeferred[$k])) {
|
||||||
else $fragmentDeferred[$k]++;
|
$fragmentDeferred[$k] = 1;
|
||||||
|
} else {
|
||||||
|
$fragmentDeferred[$k]++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$content[$k] = preg_replace('/\$DefineFragment\(' . $fragmentName . '\)/i', $fragment, $content[$k]);
|
$content[$k] = preg_replace('/\$DefineFragment\(' . $fragmentName . '\)/i', $fragment, $content[$k]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user