recursiveTagParse($text, $frame); if (!$masonryParams) { return '' . wfMessage('isekai-masonry-item-must-in-masonry')->parse() . '' . $content; } $maxCol = $masonryParams['cols']; $className = ['isekai-masonry-item']; if (isset($params['col'])) { $value = $params['col']; $col = $value === 'full' ? $maxCol : min(12, intval($value)); $className[] = 'col-' . $col; } else { $className[] = 'col-1'; } if (isset($params['xs-col'])) { $value = $params['xs-col']; $col = $value === 'full' ? $maxCol : min(12, intval($value)); $className[] = 'col-xs-' . $col; } if (isset($params['sm-col'])) { $value = $params['sm-col']; $col = $value === 'full' ? $maxCol : min(12, intval($value)); $className[] = 'col-sm-' . $col; } if (isset($params['md-col'])) { $value = $params['md-col']; $col = $value === 'full' ? $maxCol : min(12, intval($value)); $className[] = 'col-md-' . $col; } if (isset($params['lg-col'])) { $value = $params['lg-col']; $col = $value === 'full' ? $maxCol : min(12, intval($value)); $className[] = 'col-lg-' . $col; } if (isset($params['xl-col'])) { $value = $params['xl-col']; $col = $value === 'full' ? $maxCol : min(12, intval($value)); $className[] = 'col-xl-' . $col; } return Html::openElement('div', [ 'class' => implode(' ', $className), ]) . $content . Html::closeElement('div'); } }