/**
  * Returns the web path of the background image
  *
  * @return string The web path of the background image
  */
 public static function getBackgroundImagePathWeb()
 {
     include_once "./Services/Utilities/classes/class.ilUtil.php";
     return str_replace(ilUtil::removeTrailingPathSeparators(ILIAS_ABSOLUTE_PATH), ilUtil::removeTrailingPathSeparators(ILIAS_HTTP_PATH), ilObjCertificateSettingsAccess::getBackgroundImagePath());
 }
Example #2
0
 /**
  * Builds an export file in ZIP format and delivers it
  */
 public function deliverExportFileXML()
 {
     include_once "./Services/Utilities/classes/class.ilUtil.php";
     $exportpath = $this->createArchiveDirectory();
     ilUtil::makeDir($exportpath);
     $xsl = file_get_contents($this->getXSLPath());
     $xslexport = str_replace($this->getAdapter()->getCertificatePath(), "", $xsl);
     // save export xsl file
     $this->saveCertificate($xslexport, $exportpath . $this->getXSLName());
     // save background image
     if ($this->hasBackgroundImage()) {
         copy($this->getBackgroundImagePath(), $exportpath . $this->getBackgroundImageName());
     } else {
         include_once "./Services/Certificate/classes/class.ilObjCertificateSettingsAccess.php";
         if (ilObjCertificateSettingsAccess::hasBackgroundImage()) {
             copy(ilObjCertificateSettingsAccess::getBackgroundImagePath(), $exportpath . ilObjCertificateSettingsAccess::getBackgroundImageName());
         }
     }
     $zipfile = time() . "__" . IL_INST_ID . "__" . $this->getAdapter()->getAdapterType() . "__" . $this->getAdapter()->getCertificateId() . "__certificate.zip";
     ilUtil::zip($exportpath, $this->getAdapter()->getCertificatePath() . $zipfile);
     ilUtil::delDir($exportpath);
     ilUtil::deliverFile($this->getAdapter()->getCertificatePath() . $zipfile, $zipfile, "application/zip");
 }