Пример #1
0
 /**
  *  creates the METS:div element for a submission
  */
 function generateArticleDiv(&$doc, &$root, &$article, &$issue)
 {
     $pDiv =& XMLCustomWriter::createElement($doc, 'METS:div');
     XMLCustomWriter::setAttribute($pDiv, 'TYPE', 'article');
     XMLCustomWriter::setAttribute($pDiv, 'DMDID', 'A-' . $article->getId());
     $articleGalleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $i = 0;
     $galleysArray =& $articleGalleyDao->getGalleysByArticle($article->getId());
     while ($i < sizeof($galleysArray)) {
         MetsExportDom::generateArticleFileDiv($doc, $pDiv, $galleysArray[$i]);
         if ($galleysArray[$i]->isHTMLGalley()) {
             $images = $galleysArray[$i]->getImageFiles();
             foreach ($images as $image) {
                 MetsExportDom::generateArticleHtmlGalleyImageFileDiv($doc, $pDiv, $image, $article);
             }
         }
         $i++;
     }
     $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
     $suppFilesArray =& $suppFileDao->getSuppFilesByArticle($article->getId());
     $i = 0;
     while ($i < sizeof($suppFilesArray)) {
         MetsExportDom::generateArticleSuppFilesDiv($doc, $pDiv, $suppFilesArray[$i]);
         $i++;
     }
     XMLCustomWriter::appendChild($root, $pDiv);
 }