Skip to content

Commit

Permalink
Upgrade script from 14.0.0-A3 to 14.0.0-B1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Trofimov committed May 8, 2024
1 parent 3a5374d commit aeb966b
Show file tree
Hide file tree
Showing 6 changed files with 793 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3057,6 +3057,8 @@ function _compileContent($sContent, $aVarName, $iVarDepth, $aVarValues, $mixedKe
$aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml);

for($i = 0; $i < count($aKeys); $i++) {
$sVarNameKey = $aVarName . "['" . $aKeys[$i] . "']";

if(strpos($aKeys[$i], 'bx_repeat:') === 0) {
$sKey = "'<" . $aKeys[$i] . ">(.*)<\/" . $aKeys[$i] . ">'s";

Expand All @@ -3069,32 +3071,36 @@ function _compileContent($sContent, $aVarName, $iVarDepth, $aVarValues, $mixedKe
return false;

$sIndex = "\$" . str_repeat("i", $iVarDepth);
$sValue .= "<?php if(is_array(" . $aVarName . "['" . $aKeys[$i] . "'])) for(" . $sIndex . "=0; " . $sIndex . "<count(" . $aVarName . "['" . $aKeys[$i] . "']); " . $sIndex . "++){ ?>";
if(($sInnerValue = $this->_compileContent($aMatches[1], $aVarName . "['" . $aKeys[$i] . "'][" . $sIndex . "]", $iVarDepth + 1, current($aValues[$i]), $mixedKeyWrapperHtml)) === false)
$sValue .= "<?php if(is_array(" . $sVarNameKey . ")) for(" . $sIndex . "=0; " . $sIndex . "<count(" . $sVarNameKey . "); " . $sIndex . "++){ ?>";
if(($sInnerValue = $this->_compileContent($aMatches[1], $sVarNameKey . "[" . $sIndex . "]", $iVarDepth + 1, current($aValues[$i]), $mixedKeyWrapperHtml)) === false)
return false;

$sValue .= $sInnerValue;
$sValue .= "<?php } else if(is_string(" . $aVarName . "['" . $aKeys[$i] . "'])) echo " . $aVarName . "['" . $aKeys[$i] . "']; ?>";
$sValue .= "<?php } else if(is_string(" . $sVarNameKey . ")) echo " . $sVarNameKey . "; ?>";
}
} else if(strpos($aKeys[$i], 'bx_if:') === 0) {
}
else if(strpos($aKeys[$i], 'bx_if:') === 0) {
$sKey = "'<" . $aKeys[$i] . ">(.*)<\/" . $aKeys[$i] . ">'s";

$aMatches = array();
preg_match($sKey, $sContent, $aMatches);

$sValue = '';
if(isset($aMatches[1]) && !empty($aMatches[1])) {
if(!is_array($aValues[$i]) || !isset($aValues[$i]['content']) || empty($aValues[$i]['content']) || !is_array($aValues[$i]['content']))
if(!is_array($aValues[$i]) || empty($aValues[$i]['content']) || !is_array($aValues[$i]['content']))
return false;

$sValue .= "<?php if(" . $aVarName . "['" . $aKeys[$i] . "']['condition']){ ?>";
if(($sInnerValue = $this->_compileContent($aMatches[1], $aVarName . "['" . $aKeys[$i] . "']['content']", $iVarDepth, $aValues[$i]['content'], $mixedKeyWrapperHtml)) === false)
$sValue .= "<?php if(isset(" . $sVarNameKey .") && " . $sVarNameKey . "['condition']){ ?>";
if(($sInnerValue = $this->_compileContent($aMatches[1], $sVarNameKey . "['content']", $iVarDepth, $aValues[$i]['content'], $mixedKeyWrapperHtml)) === false)
return false;

$sValue .= $sInnerValue;
$sValue .= "<?php } ?>";
}
} else {
}
else {
$sKey = "'" . $aKeyWrappers['left'] . $aKeys[$i] . $aKeyWrappers['right'] . "'s";
$sValue = "<?php echo " . $aVarName . "['" . $aKeys[$i] . "'];?>";
$sValue = "<?php echo(isset(" . $sVarNameKey . ") ? " . $sVarNameKey . " : '');?>";
}

$aKeys[$i] = $sKey;
Expand Down
Loading

0 comments on commit aeb966b

Please sign in to comment.