protected function getUmiDumpObjects($v5891da2d64975cae48d175d1e001f5da, $vaf721e88e6c0a612be51c329cb2bc12a = false)
 {
     if (!$vaf721e88e6c0a612be51c329cb2bc12a) {
         $vaf721e88e6c0a612be51c329cb2bc12a = $this->getSourceName();
     }
     $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter($vaf721e88e6c0a612be51c329cb2bc12a);
     $ved780287e302ec3b9fd3c5e78771919f->addObjects($v5891da2d64975cae48d175d1e001f5da);
     $ved780287e302ec3b9fd3c5e78771919f->setIgnoreRelations();
     $result = $ved780287e302ec3b9fd3c5e78771919f->execute();
     return $result->saveXML();
 }
 public function export($v92ec19ffde05e15769b1bb3ee05ad745)
 {
     $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
     $v8be74552df93e31bbdd6b36ed74bdb6a->types('hierarchy-type')->name('catalog', 'object');
     if (count($v92ec19ffde05e15769b1bb3ee05ad745)) {
         foreach ($v92ec19ffde05e15769b1bb3ee05ad745 as $v9603a224b40d7b67210b78f2e390d00f) {
             $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page($v9603a224b40d7b67210b78f2e390d00f->id)->childs(1000);
         }
     }
     $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter("CommerceML2");
     $ved780287e302ec3b9fd3c5e78771919f->addElements($v8be74552df93e31bbdd6b36ed74bdb6a->result());
     $ved780287e302ec3b9fd3c5e78771919f->setIgnoreRelations();
     $vbbd738a112791dd1d0cb6bd0d61d878f = $ved780287e302ec3b9fd3c5e78771919f->execute();
     $vd0c75bac742760cf71fd76cd75d0c02a = './xsl/export/' . $this->type . '.xsl';
     if (!is_file($vd0c75bac742760cf71fd76cd75d0c02a)) {
         throw new publicException("Can't load exporter {$vd0c75bac742760cf71fd76cd75d0c02a}");
     }
     $v9a09b4dfda82e3e665e31092d1c3ec8d = new DOMDocument("1.0", "utf-8");
     $v9a09b4dfda82e3e665e31092d1c3ec8d->formatOutput = XML_FORMAT_OUTPUT;
     $v9a09b4dfda82e3e665e31092d1c3ec8d->loadXML($vbbd738a112791dd1d0cb6bd0d61d878f->saveXML());
     $v640eac53ad75db5c49a9ec86390d8530 = umiTemplater::create('XSLT', $vd0c75bac742760cf71fd76cd75d0c02a);
     return $v640eac53ad75db5c49a9ec86390d8530->parse($v9a09b4dfda82e3e665e31092d1c3ec8d);
 }
 public function export($v92ec19ffde05e15769b1bb3ee05ad745)
 {
     set_time_limit(0);
     if (!count($v92ec19ffde05e15769b1bb3ee05ad745)) {
         $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
         $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page(0)->childs(0);
         $v92ec19ffde05e15769b1bb3ee05ad745 = $v8be74552df93e31bbdd6b36ed74bdb6a->result;
     }
     if (getRequest('as_file') === '0') {
         $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter($this->getSourceName());
         $ved780287e302ec3b9fd3c5e78771919f->addBranches($v92ec19ffde05e15769b1bb3ee05ad745);
         $result = $ved780287e302ec3b9fd3c5e78771919f->execute();
         return $result->saveXML();
     }
     $v857a5246dff0c3c79e476b004684f6d3 = "./sys-temp/export/";
     $vb80bb7740288fda1f201890375a60c8f = getRequest('param0');
     $v97fd815a3803a0588876bdd862014fed = $v857a5246dff0c3c79e476b004684f6d3 . $vb80bb7740288fda1f201890375a60c8f . "." . parent::getFileExt();
     $v6990a54322d9232390a784c5c9247dd6 = $v857a5246dff0c3c79e476b004684f6d3 . $vb80bb7740288fda1f201890375a60c8f;
     if (!is_dir($v6990a54322d9232390a784c5c9247dd6)) {
         mkdir($v6990a54322d9232390a784c5c9247dd6, 0777, true);
     }
     if (file_exists($v97fd815a3803a0588876bdd862014fed) && !file_exists(CURRENT_WORKING_DIR . '/sys-temp/runtime-cache/' . md5($this->getSourceName()))) {
         unlink($v97fd815a3803a0588876bdd862014fed);
     }
     if ($v92ec19ffde05e15769b1bb3ee05ad745) {
         $v33030abc929f083da5f6c3f755b46034 = array('./tpls/', './xsltTpls/', './css/', './js/', './usels/', './umaps/', './templates/');
         foreach ($v33030abc929f083da5f6c3f755b46034 as $v100664c6e2c0333b19a729f2f3ddb7dd) {
             if (is_dir($v100664c6e2c0333b19a729f2f3ddb7dd)) {
                 $v736007832d2167baaae763fd3a3f3cf1 = new umiDirectory($v100664c6e2c0333b19a729f2f3ddb7dd);
                 $v45b963397aa40d4a0063e0d85e4fe7a1 = $v736007832d2167baaae763fd3a3f3cf1->getAllFiles(1);
                 foreach ($v45b963397aa40d4a0063e0d85e4fe7a1 as $vd6fe1d0be6347b8ef2427fa629c04485 => $vb068931cc450442b63f5b3d276ea4297) {
                     $v8c7dd922ad47494fc02c388e12c00eac = new umiFile($vd6fe1d0be6347b8ef2427fa629c04485);
                     if (!is_dir($v6990a54322d9232390a784c5c9247dd6 . ltrim($v8c7dd922ad47494fc02c388e12c00eac->getDirName(), '.'))) {
                         mkdir($v6990a54322d9232390a784c5c9247dd6 . ltrim($v8c7dd922ad47494fc02c388e12c00eac->getDirName(), '.'), 0777, true);
                     }
                     copy($v8c7dd922ad47494fc02c388e12c00eac->getFilePath(), $v6990a54322d9232390a784c5c9247dd6 . $v8c7dd922ad47494fc02c388e12c00eac->getFilePath(true));
                 }
             }
         }
     }
     $v71b70dd1e455c477220693d84ccd5682 = $v97fd815a3803a0588876bdd862014fed . '.tmp';
     $v480d1b61a0432d1319f7504a3d7318dd = (int) mainConfiguration::getInstance()->get("modules", "exchange.export.limit");
     if ($v480d1b61a0432d1319f7504a3d7318dd <= 0) {
         $v480d1b61a0432d1319f7504a3d7318dd = 25;
     }
     $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter($this->getSourceName(), $v480d1b61a0432d1319f7504a3d7318dd);
     $ved780287e302ec3b9fd3c5e78771919f->addBranches($v92ec19ffde05e15769b1bb3ee05ad745);
     $vdd988cfd769c9f7fbd795a0f5da8e751 = $ved780287e302ec3b9fd3c5e78771919f->execute();
     if (file_exists($v97fd815a3803a0588876bdd862014fed)) {
         $v1de9b0a30075ae8c303eb420c103c320 = new XMLReader();
         $va82feee3cc1af8bcabda979e8775ef0f = new XMLWriter();
         $v1de9b0a30075ae8c303eb420c103c320->open($v97fd815a3803a0588876bdd862014fed);
         $va82feee3cc1af8bcabda979e8775ef0f->openURI($v71b70dd1e455c477220693d84ccd5682);
         $va82feee3cc1af8bcabda979e8775ef0f->startDocument('1.0', 'utf-8');
         $va82feee3cc1af8bcabda979e8775ef0f->startElement('umidump');
         $va82feee3cc1af8bcabda979e8775ef0f->writeAttribute('version', '2.0');
         $va82feee3cc1af8bcabda979e8775ef0f->writeAttribute('xmlns:xlink', 'http://www.w3.org/TR/xlink');
         $v7aa28ed115707345d0274032757e8991 = $v1de9b0a30075ae8c303eb420c103c320->read();
         while ($v7aa28ed115707345d0274032757e8991) {
             if ($v1de9b0a30075ae8c303eb420c103c320->nodeType == XMLReader::ELEMENT) {
                 $ve24455211a964330063a18670d943835 = $v1de9b0a30075ae8c303eb420c103c320->name;
                 if ($ve24455211a964330063a18670d943835 != 'umidump') {
                     $va82feee3cc1af8bcabda979e8775ef0f->startElement($ve24455211a964330063a18670d943835);
                     if ($ve24455211a964330063a18670d943835 != 'meta') {
                         if (!$v1de9b0a30075ae8c303eb420c103c320->isEmptyElement) {
                             $v7852ddca47412c0d947ebf27eb83ed3a = $v1de9b0a30075ae8c303eb420c103c320->read();
                             while ($v7852ddca47412c0d947ebf27eb83ed3a) {
                                 if ($v1de9b0a30075ae8c303eb420c103c320->nodeType == XMLReader::ELEMENT) {
                                     $vcf7f5c76225a101e6320a96c02f92fc1 = $v1de9b0a30075ae8c303eb420c103c320->name;
                                     $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($v1de9b0a30075ae8c303eb420c103c320->readOuterXML());
                                     $v7852ddca47412c0d947ebf27eb83ed3a = $v1de9b0a30075ae8c303eb420c103c320->next();
                                 } elseif ($v1de9b0a30075ae8c303eb420c103c320->nodeType == XMLReader::END_ELEMENT && $v1de9b0a30075ae8c303eb420c103c320->name == $ve24455211a964330063a18670d943835) {
                                     $v7852ddca47412c0d947ebf27eb83ed3a = false;
                                 } else {
                                     $v7852ddca47412c0d947ebf27eb83ed3a = $v1de9b0a30075ae8c303eb420c103c320->next();
                                 }
                             }
                         }
                         if ($vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName($ve24455211a964330063a18670d943835)->item(0)->hasChildNodes()) {
                             $v268184c12df027f536154d099d497b31 = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName($ve24455211a964330063a18670d943835)->item(0)->childNodes;
                             foreach ($v268184c12df027f536154d099d497b31 as $v1b7d5726533ab525a8760351e9b5e415) {
                                 $va5e171f642af8e3bd24c50cdc4d66fe3 = new DOMDocument();
                                 $va5e171f642af8e3bd24c50cdc4d66fe3->formatOutput = true;
                                 $v36c4536996ca5615dcf9911f068786dc = $va5e171f642af8e3bd24c50cdc4d66fe3->importNode($v1b7d5726533ab525a8760351e9b5e415, true);
                                 $va5e171f642af8e3bd24c50cdc4d66fe3->appendChild($v36c4536996ca5615dcf9911f068786dc);
                                 $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($va5e171f642af8e3bd24c50cdc4d66fe3->saveXML($v36c4536996ca5615dcf9911f068786dc, LIBXML_NOXMLDECL));
                             }
                         }
                     } elseif ($ve24455211a964330063a18670d943835 == 'meta') {
                         $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($v1de9b0a30075ae8c303eb420c103c320->readInnerXML());
                         $v92ec19ffde05e15769b1bb3ee05ad745 = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName('branches');
                         if ($v92ec19ffde05e15769b1bb3ee05ad745->item(0)) {
                             $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($vdd988cfd769c9f7fbd795a0f5da8e751->saveXML($v92ec19ffde05e15769b1bb3ee05ad745->item(0), LIBXML_NOXMLDECL));
                         }
                     }
                     $va82feee3cc1af8bcabda979e8775ef0f->fullEndElement();
                     $v7aa28ed115707345d0274032757e8991 = $v1de9b0a30075ae8c303eb420c103c320->next();
                     continue;
                 }
             }
             $v7aa28ed115707345d0274032757e8991 = $v1de9b0a30075ae8c303eb420c103c320->read();
         }
         $va82feee3cc1af8bcabda979e8775ef0f->fullEndElement();
         $v1de9b0a30075ae8c303eb420c103c320->close();
         $va82feee3cc1af8bcabda979e8775ef0f->endDocument();
         $va82feee3cc1af8bcabda979e8775ef0f->flush();
         unlink($v97fd815a3803a0588876bdd862014fed);
         rename($v71b70dd1e455c477220693d84ccd5682, $v97fd815a3803a0588876bdd862014fed);
     } else {
         file_put_contents($v97fd815a3803a0588876bdd862014fed, $vdd988cfd769c9f7fbd795a0f5da8e751->saveXML());
     }
     $this->completed = $ved780287e302ec3b9fd3c5e78771919f->isCompleted();
     return false;
 }
 public function updateYML()
 {
     $v100664c6e2c0333b19a729f2f3ddb7dd = CURRENT_WORKING_DIR . "/sys-temp/yml/";
     $v100664c6e2c0333b19a729f2f3ddb7dd = CURRENT_WORKING_DIR . "/sys-temp/yml/";
     $v6942e8fa62b3cc9d93881a58210e2fd7 = umiHierarchyTypesCollection::getInstance();
     $v8c028488715d341980c5985fd02bfa1e = $v6942e8fa62b3cc9d93881a58210e2fd7->getTypeByName("catalog", "object");
     $v3e78669aa9a1bfe336037e3d77a22705 = $v6942e8fa62b3cc9d93881a58210e2fd7->getTypeByName("catalog", "category");
     $vb81ca7c0ccaa77e7aa91936ab0070695 = umiHierarchy::getInstance();
     if (!$v8c028488715d341980c5985fd02bfa1e || !$v3e78669aa9a1bfe336037e3d77a22705) {
         return false;
     }
     if ($this->getHierarchyType()->getId() == $v3e78669aa9a1bfe336037e3d77a22705->getId()) {
         $this->checkYMLinclude();
         if (!$this->is_active || $this->is_deleted) {
             $v397c47bd29ed2de23a264b3de9d0aeaf = $vb81ca7c0ccaa77e7aa91936ab0070695->getChildIds($this->getId(), false);
             foreach ($v397c47bd29ed2de23a264b3de9d0aeaf as $vf4f40123eb510dd3290125b38f4eb898) {
                 $v0f635d0e0f3874fff8b581c132e6c7a7 = $v100664c6e2c0333b19a729f2f3ddb7dd . $vf4f40123eb510dd3290125b38f4eb898 . ".txt";
                 if (file_exists($v0f635d0e0f3874fff8b581c132e6c7a7)) {
                     unlink($v0f635d0e0f3874fff8b581c132e6c7a7);
                 }
             }
         }
         return true;
     }
     if ($this->getHierarchyType()->getId() != $v8c028488715d341980c5985fd02bfa1e->getId()) {
         return false;
     }
     if (!is_dir($v100664c6e2c0333b19a729f2f3ddb7dd)) {
         mkdir($v100664c6e2c0333b19a729f2f3ddb7dd, 0777, true);
     }
     $v0f635d0e0f3874fff8b581c132e6c7a7 = $v100664c6e2c0333b19a729f2f3ddb7dd . "{$this->id}.txt";
     if (file_exists($v0f635d0e0f3874fff8b581c132e6c7a7)) {
         unlink($v0f635d0e0f3874fff8b581c132e6c7a7);
     }
     if ($this->is_active && !$this->is_deleted) {
         $v9c28d32df234037773be184dbdafc274 = $this->checkYMLinclude();
         if (!count($v9c28d32df234037773be184dbdafc274)) {
             return false;
         }
         $vbfa030fe63bacd523dd70a76cfaed98a = $this->getParentId();
         if ($vbfa030fe63bacd523dd70a76cfaed98a) {
             $vd0e45878043844ffc41aac437e86b602 = umiHierarchy::getInstance()->getElement($vbfa030fe63bacd523dd70a76cfaed98a, true, true);
             if ($vd0e45878043844ffc41aac437e86b602->getHierarchyType()->getId() != $v3e78669aa9a1bfe336037e3d77a22705->getId()) {
                 $vbfa030fe63bacd523dd70a76cfaed98a = false;
                 $vc68ad910ed49ac65f21f1bf2c5dbf912 = $vb81ca7c0ccaa77e7aa91936ab0070695->getAllParents($this->id, true, true);
                 for ($v865c0c0b4ab0e063e5caa3387c1a8741 = count($vc68ad910ed49ac65f21f1bf2c5dbf912) - 1; $v865c0c0b4ab0e063e5caa3387c1a8741 >= 0; $v865c0c0b4ab0e063e5caa3387c1a8741--) {
                     $veb26d1e3d9eea8920caf827a786b187f = $vc68ad910ed49ac65f21f1bf2c5dbf912[$v865c0c0b4ab0e063e5caa3387c1a8741];
                     $v0b7a661d35d52d96b26b9f3f3bd32aab = $vb81ca7c0ccaa77e7aa91936ab0070695->getElement($veb26d1e3d9eea8920caf827a786b187f, true);
                     if ($v0b7a661d35d52d96b26b9f3f3bd32aab instanceof umiHierarchyElement && $v0b7a661d35d52d96b26b9f3f3bd32aab->getHierarchyType()->getId() == $v3e78669aa9a1bfe336037e3d77a22705->getId()) {
                         $vbfa030fe63bacd523dd70a76cfaed98a = $veb26d1e3d9eea8920caf827a786b187f;
                         break;
                     }
                 }
             }
         }
         if (!$vbfa030fe63bacd523dd70a76cfaed98a) {
             throw new publicAdminException(getLabel('error-update-yml'));
         }
         $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter('yml');
         $ved780287e302ec3b9fd3c5e78771919f->addElements(array($this->id));
         $ved780287e302ec3b9fd3c5e78771919f->setIgnoreRelations();
         $vbbd738a112791dd1d0cb6bd0d61d878f = $ved780287e302ec3b9fd3c5e78771919f->execute();
         $vd0c75bac742760cf71fd76cd75d0c02a = CURRENT_WORKING_DIR . '/xsl/export/YML.xsl';
         if (!is_file($vd0c75bac742760cf71fd76cd75d0c02a)) {
             throw new publicException("Can't load exporter {$vd0c75bac742760cf71fd76cd75d0c02a}");
         }
         $v9a09b4dfda82e3e665e31092d1c3ec8d = new DOMDocument("1.0", "utf-8");
         $v9a09b4dfda82e3e665e31092d1c3ec8d->formatOutput = XML_FORMAT_OUTPUT;
         $v9a09b4dfda82e3e665e31092d1c3ec8d->loadXML($vbbd738a112791dd1d0cb6bd0d61d878f->saveXML());
         $v640eac53ad75db5c49a9ec86390d8530 = umiTemplater::create('XSLT', $vd0c75bac742760cf71fd76cd75d0c02a);
         $result = $v640eac53ad75db5c49a9ec86390d8530->parse($v9a09b4dfda82e3e665e31092d1c3ec8d);
         $vdd988cfd769c9f7fbd795a0f5da8e751 = new DOMDocument();
         $vdd988cfd769c9f7fbd795a0f5da8e751->loadXML($result);
         $vd60db28d94d538bbb249dcc7f2273ab1 = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName('offer')->item(0);
         if ($vd60db28d94d538bbb249dcc7f2273ab1) {
             $vc4ef352f74e502ef5e7bc98e6f4e493d = $vd60db28d94d538bbb249dcc7f2273ab1->getElementsByTagName('categoryId')->item(0);
             if ($vc4ef352f74e502ef5e7bc98e6f4e493d) {
                 $vc4ef352f74e502ef5e7bc98e6f4e493d->nodeValue = $vbfa030fe63bacd523dd70a76cfaed98a;
             }
             $v9a0364b9e99bb480dd25e1f0284c8555 = iconv("UTF-8", "CP1251//IGNORE", $vdd988cfd769c9f7fbd795a0f5da8e751->saveXML($vd60db28d94d538bbb249dcc7f2273ab1));
             file_put_contents($v0f635d0e0f3874fff8b581c132e6c7a7, $v9a0364b9e99bb480dd25e1f0284c8555);
         }
         $v7f24d9fc4140045241b3f97bcf36bf03 = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName('currencies')->item(0);
         $v09c2a312ca0311b5e24340fe8f827077 = iconv("UTF-8", "CP1251//IGNORE", $vdd988cfd769c9f7fbd795a0f5da8e751->saveXML($v7f24d9fc4140045241b3f97bcf36bf03));
         file_put_contents($v100664c6e2c0333b19a729f2f3ddb7dd . 'currencies', $v09c2a312ca0311b5e24340fe8f827077);
         $vdaeed474badc5873f59f5c1933dfa304 = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName('name')->item(0);
         $vb068931cc450442b63f5b3d276ea4297 = $vdaeed474badc5873f59f5c1933dfa304->nodeValue;
         $v93c731f1c3a84ef05cd54d044c379eaa = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName('company')->item(0);
         $vdb486e4cdf8b2048591e59f683319c4c = $v93c731f1c3a84ef05cd54d044c379eaa->nodeValue;
         foreach ($v9c28d32df234037773be184dbdafc274 as $v013b012140e3049c2436475764dfba3c) {
             file_put_contents($v100664c6e2c0333b19a729f2f3ddb7dd . 'shop' . $v013b012140e3049c2436475764dfba3c, '<name>' . iconv("UTF-8", "CP1251//IGNORE", $vb068931cc450442b63f5b3d276ea4297) . '</name><company>' . iconv("UTF-8", "CP1251", $vdb486e4cdf8b2048591e59f683319c4c) . '</company><url>http://' . domainsCollection::getInstance()->getDomain($this->getDomainId())->getHost() . '</url>');
         }
     }
 }
 public function export($v92ec19ffde05e15769b1bb3ee05ad745)
 {
     set_time_limit(0);
     if (!count($v92ec19ffde05e15769b1bb3ee05ad745)) {
         $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
         $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page(0)->childs(0);
         $v92ec19ffde05e15769b1bb3ee05ad745 = $v8be74552df93e31bbdd6b36ed74bdb6a->result;
     }
     $v857a5246dff0c3c79e476b004684f6d3 = CURRENT_WORKING_DIR . "/sys-temp/export/";
     $vb80bb7740288fda1f201890375a60c8f = getRequest('param0');
     $v97fd815a3803a0588876bdd862014fed = $v857a5246dff0c3c79e476b004684f6d3 . $vb80bb7740288fda1f201890375a60c8f . "." . parent::getFileExt();
     if (getRequest('as_file') === '0') {
         $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter($this->getSourceName());
         $ved780287e302ec3b9fd3c5e78771919f->addBranches($v92ec19ffde05e15769b1bb3ee05ad745);
         $result = $ved780287e302ec3b9fd3c5e78771919f->execute();
         return $result->saveXML();
     }
     if (file_exists($v97fd815a3803a0588876bdd862014fed) && !file_exists(CURRENT_WORKING_DIR . '/sys-temp/runtime-cache/' . md5($this->getSourceName()))) {
         unlink($v97fd815a3803a0588876bdd862014fed);
     }
     $v71b70dd1e455c477220693d84ccd5682 = $v97fd815a3803a0588876bdd862014fed . '.tmp';
     $v480d1b61a0432d1319f7504a3d7318dd = (int) mainConfiguration::getInstance()->get("modules", "exchange.export.limit");
     if ($v480d1b61a0432d1319f7504a3d7318dd <= 0) {
         $v480d1b61a0432d1319f7504a3d7318dd = 25;
     }
     $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter($this->getSourceName(), $v480d1b61a0432d1319f7504a3d7318dd);
     $ved780287e302ec3b9fd3c5e78771919f->addBranches($v92ec19ffde05e15769b1bb3ee05ad745);
     $vdd988cfd769c9f7fbd795a0f5da8e751 = $ved780287e302ec3b9fd3c5e78771919f->execute();
     if (file_exists($v97fd815a3803a0588876bdd862014fed)) {
         $v1de9b0a30075ae8c303eb420c103c320 = new XMLReader();
         $va82feee3cc1af8bcabda979e8775ef0f = new XMLWriter();
         $v1de9b0a30075ae8c303eb420c103c320->open($v97fd815a3803a0588876bdd862014fed);
         $va82feee3cc1af8bcabda979e8775ef0f->openURI($v71b70dd1e455c477220693d84ccd5682);
         $va82feee3cc1af8bcabda979e8775ef0f->startDocument('1.0', 'utf-8');
         $va82feee3cc1af8bcabda979e8775ef0f->startElement('umidump');
         $va82feee3cc1af8bcabda979e8775ef0f->writeAttribute('version', '2.0');
         $va82feee3cc1af8bcabda979e8775ef0f->writeAttribute('xmlns:xlink', 'http://www.w3.org/TR/xlink');
         $v7aa28ed115707345d0274032757e8991 = $v1de9b0a30075ae8c303eb420c103c320->read();
         while ($v7aa28ed115707345d0274032757e8991) {
             if ($v1de9b0a30075ae8c303eb420c103c320->nodeType == XMLReader::ELEMENT) {
                 $ve24455211a964330063a18670d943835 = $v1de9b0a30075ae8c303eb420c103c320->name;
                 if ($ve24455211a964330063a18670d943835 != 'umidump') {
                     $va82feee3cc1af8bcabda979e8775ef0f->startElement($ve24455211a964330063a18670d943835);
                     if ($ve24455211a964330063a18670d943835 != 'meta') {
                         if (!$v1de9b0a30075ae8c303eb420c103c320->isEmptyElement) {
                             $v7852ddca47412c0d947ebf27eb83ed3a = $v1de9b0a30075ae8c303eb420c103c320->read();
                             while ($v7852ddca47412c0d947ebf27eb83ed3a) {
                                 if ($v1de9b0a30075ae8c303eb420c103c320->nodeType == XMLReader::ELEMENT) {
                                     $vcf7f5c76225a101e6320a96c02f92fc1 = $v1de9b0a30075ae8c303eb420c103c320->name;
                                     $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($v1de9b0a30075ae8c303eb420c103c320->readOuterXML());
                                     $v7852ddca47412c0d947ebf27eb83ed3a = $v1de9b0a30075ae8c303eb420c103c320->next();
                                 } elseif ($v1de9b0a30075ae8c303eb420c103c320->nodeType == XMLReader::END_ELEMENT && $v1de9b0a30075ae8c303eb420c103c320->name == $ve24455211a964330063a18670d943835) {
                                     $v7852ddca47412c0d947ebf27eb83ed3a = false;
                                 } else {
                                     $v7852ddca47412c0d947ebf27eb83ed3a = $v1de9b0a30075ae8c303eb420c103c320->next();
                                 }
                             }
                         }
                         if ($vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName($ve24455211a964330063a18670d943835)->item(0)->hasChildNodes()) {
                             $v268184c12df027f536154d099d497b31 = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName($ve24455211a964330063a18670d943835)->item(0)->childNodes;
                             foreach ($v268184c12df027f536154d099d497b31 as $v1b7d5726533ab525a8760351e9b5e415) {
                                 $va5e171f642af8e3bd24c50cdc4d66fe3 = new DOMDocument();
                                 $va5e171f642af8e3bd24c50cdc4d66fe3->formatOutput = true;
                                 $v36c4536996ca5615dcf9911f068786dc = $va5e171f642af8e3bd24c50cdc4d66fe3->importNode($v1b7d5726533ab525a8760351e9b5e415, true);
                                 $va5e171f642af8e3bd24c50cdc4d66fe3->appendChild($v36c4536996ca5615dcf9911f068786dc);
                                 $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($va5e171f642af8e3bd24c50cdc4d66fe3->saveXML($v36c4536996ca5615dcf9911f068786dc, LIBXML_NOXMLDECL));
                             }
                         }
                     } elseif ($ve24455211a964330063a18670d943835 == 'meta') {
                         $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($v1de9b0a30075ae8c303eb420c103c320->readInnerXML());
                         $v92ec19ffde05e15769b1bb3ee05ad745 = $vdd988cfd769c9f7fbd795a0f5da8e751->getElementsByTagName('branches');
                         if ($v92ec19ffde05e15769b1bb3ee05ad745->item(0)) {
                             $va82feee3cc1af8bcabda979e8775ef0f->writeRaw($vdd988cfd769c9f7fbd795a0f5da8e751->saveXML($v92ec19ffde05e15769b1bb3ee05ad745->item(0), LIBXML_NOXMLDECL));
                         }
                     }
                     $va82feee3cc1af8bcabda979e8775ef0f->fullEndElement();
                     $v7aa28ed115707345d0274032757e8991 = $v1de9b0a30075ae8c303eb420c103c320->next();
                     continue;
                 }
             }
             $v7aa28ed115707345d0274032757e8991 = $v1de9b0a30075ae8c303eb420c103c320->read();
         }
         $va82feee3cc1af8bcabda979e8775ef0f->fullEndElement();
         $v1de9b0a30075ae8c303eb420c103c320->close();
         $va82feee3cc1af8bcabda979e8775ef0f->endDocument();
         $va82feee3cc1af8bcabda979e8775ef0f->flush();
         unlink($v97fd815a3803a0588876bdd862014fed);
         rename($v71b70dd1e455c477220693d84ccd5682, $v97fd815a3803a0588876bdd862014fed);
     } else {
         file_put_contents($v97fd815a3803a0588876bdd862014fed, $vdd988cfd769c9f7fbd795a0f5da8e751->saveXML());
     }
     $this->completed = $ved780287e302ec3b9fd3c5e78771919f->isCompleted();
     return false;
 }
Esempio n. 6
0
 public function generateFeed($elementId, $xslPath, $typeId = null)
 {
     $this->errorSetErrorPage('/');
     if ($elementId && (!umiHierarchy::getInstance()->isExists($elementId) || !umiHierarchy::getInstance()->getElement($elementId)->getIsActive())) {
         if (def_module::isXSLTResultMode()) {
             $result = array('error' => '%data_feed_nofeed%');
             return def_module::parseTemplate('', $result);
         } else {
             return '%data_feed_nofeed%';
         }
     }
     if ($typeId) {
         list($name, $ext) = explode('-', $typeId);
         $hierarchyType = umiHierarchyTypesCollection::getInstance()->getTypeByName($name, $ext);
         if ($hierarchyType) {
             $typeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($hierarchyType->getId());
         }
     } elseif ($elementId) {
         $typeId = umiHierarchy::getInstance()->getDominantTypeId($elementId);
     } else {
         $typeId = umiObjectTypesCollection::getInstance()->getTypeIdByGUID('news-item');
     }
     $type = umiObjectTypesCollection::getInstance()->getType($typeId);
     if ($type instanceof umiObjectType) {
         $module = $type->getModule();
         $method = $type->getMethod();
     }
     if (!isset($module) && !isset($method)) {
         if (def_module::isXSLTResultMode()) {
             $result = array('error' => '%data_feed_nofeed%');
             return def_module::parseTemplate('', $result);
         } else {
             return '%data_feed_nofeed%';
         }
     }
     if (!$this->checkIfFeedable($module, $method)) {
         if (def_module::isXSLTResultMode()) {
             $result = array('error' => '%data_feed_wrong%');
             return def_module::parseTemplate('', $result);
         } else {
             return '%data_feed_wrong%';
         }
     }
     $rss_per_page = (int) regedit::getInstance()->getVal("//modules/news/rss_per_page");
     $rss_per_page = $rss_per_page > 0 ? $rss_per_page : 10;
     $sel = new selector('pages');
     $sel->option('return')->value('id');
     $sel->where('hierarchy')->page($elementId)->childs(100);
     $sel->types('hierarchy-type')->name($module, $method);
     if ($type->getFieldId('publish_time')) {
         $sel->order('publish_time')->desc();
     }
     $sel->limit(0, $rss_per_page);
     $result = array();
     foreach ($sel->result() as $res) {
         $result[] = $res['id'];
     }
     $exporter = new xmlExporter('rss');
     $exporter->addElements($result);
     $exporter->setIgnoreRelations();
     $umiDump = $exporter->execute();
     $styleFile = CURRENT_WORKING_DIR . "/" . $xslPath;
     if (!is_file($styleFile)) {
         throw new publicException("Can't load exporter {$styleFile}");
     }
     $doc = new DOMDocument("1.0", "utf-8");
     $doc->formatOutput = XML_FORMAT_OUTPUT;
     $doc->loadXML($umiDump->saveXML());
     if (!$elementId) {
         $elementId = umiHierarchy::getInstance()->getDefaultElementId();
     }
     $element = umiHierarchy::getInstance()->getElement($elementId);
     $language = langsCollection::getInstance()->getLang($element->getLangId())->getPrefix();
     $link = umiHierarchy::getInstance()->getPathById($elementId);
     $description = $element->getIsDefault() ? '' : $element->getName();
     $templater = umiTemplater::create('XSLT', $styleFile);
     $templater->setAdditionalVariables(array('link' => $link, 'description' => $description, 'language' => $language));
     $resultXml = $templater->parse($doc);
     $buffer = outputBuffer::current();
     $buffer->contentType('text/xml');
     $buffer->clear();
     $buffer->push($resultXml);
     $buffer->end();
 }
 public function export($v92ec19ffde05e15769b1bb3ee05ad745)
 {
     $v857a5246dff0c3c79e476b004684f6d3 = CURRENT_WORKING_DIR . "/sys-temp/export/";
     $vb80bb7740288fda1f201890375a60c8f = getRequest('param0');
     if (!is_dir($v857a5246dff0c3c79e476b004684f6d3)) {
         mkdir($v857a5246dff0c3c79e476b004684f6d3, 0777, true);
     }
     $v8e9e791281df5188f135edcc30eaa97e = $v857a5246dff0c3c79e476b004684f6d3 . $vb80bb7740288fda1f201890375a60c8f . "." . $this->getFileExt();
     $v7c95caafbd5e4b5db3977617a0498de6 = $vb80bb7740288fda1f201890375a60c8f . "." . $this->getFileExt();
     if (file_exists($v8e9e791281df5188f135edcc30eaa97e) && !file_exists($v8e9e791281df5188f135edcc30eaa97e . 'array')) {
         unlink($v8e9e791281df5188f135edcc30eaa97e);
     }
     $v2a05e4f9b3949ba2c0b7d413a0863c3f = array();
     if (!file_exists($v8e9e791281df5188f135edcc30eaa97e . 'array')) {
         if (!count($v92ec19ffde05e15769b1bb3ee05ad745)) {
             $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
             $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page(0)->childs(0);
             $v92ec19ffde05e15769b1bb3ee05ad745 = $v8be74552df93e31bbdd6b36ed74bdb6a->result;
         }
         foreach ($v92ec19ffde05e15769b1bb3ee05ad745 as $v8e2dcfd7e7e24b1ca76c1193f645902b) {
             if (!$v8e2dcfd7e7e24b1ca76c1193f645902b instanceof umiHierarchyElement) {
                 $v8e2dcfd7e7e24b1ca76c1193f645902b = umiHierarchy::getInstance()->getElement($v8e2dcfd7e7e24b1ca76c1193f645902b, true, true);
             }
             if (!$v8e2dcfd7e7e24b1ca76c1193f645902b instanceof umiHierarchyElement) {
                 continue;
             }
             $v7552cd149af7495ee7d8225974e50f80 = $v8e2dcfd7e7e24b1ca76c1193f645902b->getId();
             $v2a05e4f9b3949ba2c0b7d413a0863c3f[$v7552cd149af7495ee7d8225974e50f80] = $v7552cd149af7495ee7d8225974e50f80;
             $vc9e9a848920877e76685b2e4e76de38d = umiHierarchy::getInstance()->getMaxNestingLevel($v7552cd149af7495ee7d8225974e50f80);
             if (!$vc9e9a848920877e76685b2e4e76de38d) {
                 continue;
             }
             for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 1; $v865c0c0b4ab0e063e5caa3387c1a8741 <= $vc9e9a848920877e76685b2e4e76de38d; $v865c0c0b4ab0e063e5caa3387c1a8741++) {
                 $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
                 $v8be74552df93e31bbdd6b36ed74bdb6a->option('return')->value('id');
                 $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page($v7552cd149af7495ee7d8225974e50f80)->childs($v865c0c0b4ab0e063e5caa3387c1a8741);
                 foreach ($v8be74552df93e31bbdd6b36ed74bdb6a->result() as $v9b207167e5381c47682c6b4f58a623fb) {
                     $v2a05e4f9b3949ba2c0b7d413a0863c3f[$v9b207167e5381c47682c6b4f58a623fb['id']] = $v9b207167e5381c47682c6b4f58a623fb['id'];
                 }
             }
         }
     } else {
         $v2a05e4f9b3949ba2c0b7d413a0863c3f = unserialize(file_get_contents($v8e9e791281df5188f135edcc30eaa97e . 'array'));
     }
     $v480d1b61a0432d1319f7504a3d7318dd = false;
     if (getRequest('as_file') !== '0') {
         $v480d1b61a0432d1319f7504a3d7318dd = (int) mainConfiguration::getInstance()->get("modules", "exchange.export.limit");
         if ($v480d1b61a0432d1319f7504a3d7318dd <= 0) {
             $v480d1b61a0432d1319f7504a3d7318dd = 25;
         }
     }
     $ved780287e302ec3b9fd3c5e78771919f = new xmlExporter($v7c95caafbd5e4b5db3977617a0498de6, $v480d1b61a0432d1319f7504a3d7318dd);
     if (getRequest('as_file') !== '0') {
         $ved780287e302ec3b9fd3c5e78771919f->addElements(array_slice($v2a05e4f9b3949ba2c0b7d413a0863c3f, 0, $v480d1b61a0432d1319f7504a3d7318dd + 1));
     } else {
         $ved780287e302ec3b9fd3c5e78771919f->addElements($v2a05e4f9b3949ba2c0b7d413a0863c3f);
     }
     $ved780287e302ec3b9fd3c5e78771919f->setIgnoreRelations();
     $v9a09b4dfda82e3e665e31092d1c3ec8d = $ved780287e302ec3b9fd3c5e78771919f->execute();
     $v10ae9fc7d453b0dd525d0edf2ede7961 = $this->getCSV($v9a09b4dfda82e3e665e31092d1c3ec8d, $v8e9e791281df5188f135edcc30eaa97e);
     $ve1260894f59eeae98c8440899de4df8d = fopen($v8e9e791281df5188f135edcc30eaa97e, 'a');
     foreach ($v10ae9fc7d453b0dd525d0edf2ede7961 as $vd05b6ed7d2345020440df396d6da7f73) {
         $vb45cffe084dd3d20d928bee85e7b0f21 = "\"" . implode('";"', $vd05b6ed7d2345020440df396d6da7f73) . "\"\n";
         if ($vb45cffe084dd3d20d928bee85e7b0f21 = @iconv('utf-8', 'windows-1251//IGNORE', $vb45cffe084dd3d20d928bee85e7b0f21)) {
             fputs($ve1260894f59eeae98c8440899de4df8d, $vb45cffe084dd3d20d928bee85e7b0f21);
         }
     }
     fclose($ve1260894f59eeae98c8440899de4df8d);
     $vaa8fb77e57d1ca18d593e909729871fe = $ved780287e302ec3b9fd3c5e78771919f->isCompleted();
     if (getRequest('as_file') !== '0') {
         $vb0344c1ba7e309d30b65650c47a422c3 = $ved780287e302ec3b9fd3c5e78771919f->getExportedElements();
         $v2a05e4f9b3949ba2c0b7d413a0863c3f = array_diff($v2a05e4f9b3949ba2c0b7d413a0863c3f, $vb0344c1ba7e309d30b65650c47a422c3);
         if (count($v2a05e4f9b3949ba2c0b7d413a0863c3f)) {
             $this->completed = false;
             file_put_contents($v8e9e791281df5188f135edcc30eaa97e . 'array', serialize($v2a05e4f9b3949ba2c0b7d413a0863c3f));
         } else {
             if (file_exists($v8e9e791281df5188f135edcc30eaa97e . 'array')) {
                 unlink($v8e9e791281df5188f135edcc30eaa97e . 'array');
             }
             $this->completed = true;
         }
     } else {
         $this->completed = $vaa8fb77e57d1ca18d593e909729871fe;
     }
     if ($this->completed) {
         $v10ae9fc7d453b0dd525d0edf2ede7961 = unserialize(file_get_contents($v8e9e791281df5188f135edcc30eaa97e . ".tmp"));
         $ve1260894f59eeae98c8440899de4df8d = fopen($v8e9e791281df5188f135edcc30eaa97e . ".tmp", 'w');
         foreach ($v10ae9fc7d453b0dd525d0edf2ede7961 as $vd05b6ed7d2345020440df396d6da7f73) {
             $vb45cffe084dd3d20d928bee85e7b0f21 = "\"" . implode('";"', $vd05b6ed7d2345020440df396d6da7f73) . "\"\n";
             if ($vb45cffe084dd3d20d928bee85e7b0f21 = @iconv('utf-8', 'windows-1251//IGNORE', $vb45cffe084dd3d20d928bee85e7b0f21)) {
                 fwrite($ve1260894f59eeae98c8440899de4df8d, $vb45cffe084dd3d20d928bee85e7b0f21);
             }
         }
         $vd11e7941c75eaca417c6af0d0f9d7d45 = fopen($v8e9e791281df5188f135edcc30eaa97e, 'r');
         while ($vb45cffe084dd3d20d928bee85e7b0f21 = fgets($vd11e7941c75eaca417c6af0d0f9d7d45)) {
             if (substr_count($vb45cffe084dd3d20d928bee85e7b0f21, '"') % 2 != 0) {
                 $v132ae73e31f76d8b94f87fe5ccfe28c9 = false;
                 while (!feof($vd11e7941c75eaca417c6af0d0f9d7d45) && !$v132ae73e31f76d8b94f87fe5ccfe28c9) {
                     $vb45cffe084dd3d20d928bee85e7b0f21 .= fgets($vd11e7941c75eaca417c6af0d0f9d7d45);
                     if (substr_count($vb45cffe084dd3d20d928bee85e7b0f21, '"') % 2 == 0) {
                         $v132ae73e31f76d8b94f87fe5ccfe28c9 = true;
                     }
                 }
             }
             fwrite($ve1260894f59eeae98c8440899de4df8d, $vb45cffe084dd3d20d928bee85e7b0f21);
         }
         fclose($ve1260894f59eeae98c8440899de4df8d);
         fclose($vd11e7941c75eaca417c6af0d0f9d7d45);
         unlink($v8e9e791281df5188f135edcc30eaa97e);
         rename($v8e9e791281df5188f135edcc30eaa97e . ".tmp", $v8e9e791281df5188f135edcc30eaa97e);
     }
     chmod($v8e9e791281df5188f135edcc30eaa97e, 0777);
     return false;
 }