if ( !( $xmlFile && $archiveFilename && $archiveContext ) ) { return $module->handleError( eZError::KERNEL_NOT_FOUND ); } $archive = MMImportMonotorArchive::instance( $archiveContext ); if ( !( $archive instanceof MMImportMonotorArchive ) ) { return $module->handleError( eZError::KERNEL_NOT_FOUND ); } $cmd = 'unzip -o "' . $archive->getPath() . '/' . $archiveFilename . '" "' . $xmlFile . '" -d /tmp'; exec( $cmd, $output ); $filename = "/tmp/$xmlFile"; $xml = file_get_contents( $filename ); if ( preg_match( '/\/.*([a-f0-9]{32}_.+\.xml)$/', $xmlFile, $matches ) ) { $xmlFile = $matches[1]; } $xmlDetails = MMImportMonitorHelper::getXmlDetails( $xmlFile ); $tpl->setVariable( 'xml', $xml ); $tpl->setVariable( 'xml_details', $xmlDetails ); $Result['content'] = $tpl->fetch( 'design:importmonitor/xmlfile.tpl' ); $Result['path'] = array( array('url' => '/monitor/dashboard', 'text' => 'Dashboard'), array('url' => false, 'text' => 'XML file'), );