21 public function process(\DOMElement $mediaNode, $mediaParentTag)
25 $moduleNameImage = $mediaNode->getAttribute(
'module');
27 $imageId = $node->getAttribute(
'id');
29 = $node->getAttribute(
'type');
31 if (
$attribute->nodeType != XML_ELEMENT_NODE) {
35 if ((
bool)
$attribute->getAttribute(
'xsi:nil') !==
true) {
36 if ($attributeTagName ===
'background') {
37 $nodeValue = $this->processImageBackground(
$attribute->nodeValue);
38 }
elseif ($attributeTagName ===
'width' || $attributeTagName ===
'height') {
60 private function processImageBackground($backgroundString)
62 $pattern =
'#\[(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\]#';
63 $backgroundArray = [];
64 if (preg_match(
$pattern, $backgroundString, $backgroundArray)) {
65 array_shift($backgroundArray);
66 $backgroundArray = array_map(
'intval', $backgroundArray);
68 return $backgroundArray;
elseif(isset( $params[ 'redirect_parent']))
const MEDIA_TYPE_CONFIG_NODE