ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestPDFGenerator Class Reference

Class ilTestPDFGenerator. More...

+ Collaboration diagram for ilTestPDFGenerator:

Static Public Member Functions

static generatePDF ($pdf_output, $output_mode, $filename=null, $purpose=null)
 
static preprocessHTML ($html)
 

Data Fields

const PDF_OUTPUT_DOWNLOAD = 'D'
 
const PDF_OUTPUT_INLINE = 'I'
 
const PDF_OUTPUT_FILE = 'F'
 
const service = "Test"
 

Static Protected Member Functions

static getTemplatePath ($a_filename, $module_path='Modules/Test/')
 
static getCssContent ()
 

Static Private Member Functions

static buildHtmlDocument ($contentHtml, $styleHtml)
 

Detailed Description

Class ilTestPDFGenerator.

Class that handles PDF generation for test and assessment.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 16 of file class.ilTestPDFGenerator.php.

Member Function Documentation

◆ buildHtmlDocument()

static ilTestPDFGenerator::buildHtmlDocument (   $contentHtml,
  $styleHtml 
)
staticprivate

Definition at line 24 of file class.ilTestPDFGenerator.php.

References $html.

25  {
26  return "
27  <html>
28  <head>
29  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
30  $styleHtml
31  </head>
32  <body>$contentHtml</body>
33  </html>
34  ";
35  }

◆ generatePDF()

static ilTestPDFGenerator::generatePDF (   $pdf_output,
  $output_mode,
  $filename = null,
  $purpose = null 
)
static

◆ getCssContent()

static ilTestPDFGenerator::getCssContent ( )
staticprotected

Definition at line 130 of file class.ilTestPDFGenerator.php.

131  {
132  $cssContent = file_get_contents(self::getTemplatePath('delos.css', ''));
133  $cssContent .= file_get_contents(self::getTemplatePath('test_pdf.css'));
134 
135  return $cssContent;
136  }

◆ getTemplatePath()

static ilTestPDFGenerator::getTemplatePath (   $a_filename,
  $module_path = 'Modules/Test/' 
)
staticprotected

Definition at line 115 of file class.ilTestPDFGenerator.php.

References ilStyleDefinition\getCurrentSkin().

116  {
117  // use ilStyleDefinition instead of account to get the current skin
118  include_once "Services/Style/System/classes/class.ilStyleDefinition.php";
119  if (ilStyleDefinition::getCurrentSkin() != "default") {
120  $fname = "./Customizing/global/skin/" .
121  ilStyleDefinition::getCurrentSkin() . "/" . $module_path . basename($a_filename);
122  }
123 
124  if ($fname == "" || !file_exists($fname)) {
125  $fname = "./" . $module_path . "templates/default/" . basename($a_filename);
126  }
127  return $fname;
128  }
static getCurrentSkin()
get the current skin
+ Here is the call graph for this function:

◆ preprocessHTML()

static ilTestPDFGenerator::preprocessHTML (   $html)
static

Definition at line 108 of file class.ilTestPDFGenerator.php.

References $html.

109  {
110  $html = self::makeHtmlDocument($html, '<style>' . self::getCssContent() . '</style>');
111 
112  return $html;
113  }
$html
Definition: example_001.php:87

Field Documentation

◆ PDF_OUTPUT_DOWNLOAD

◆ PDF_OUTPUT_FILE

◆ PDF_OUTPUT_INLINE

const ilTestPDFGenerator::PDF_OUTPUT_INLINE = 'I'

Definition at line 19 of file class.ilTestPDFGenerator.php.

◆ service

const ilTestPDFGenerator::service = "Test"

Definition at line 22 of file class.ilTestPDFGenerator.php.


The documentation for this class was generated from the following file: