|
static | prepareGenerationRequest (string $service, string $purpose) |
| Prepare the content processing for a PDF generation request This function should be called as in a request before any content is generated It sets the generation mode for Latex processing according the needs of the PDF renderer. More...
|
|
static | getTestPdfDir () |
|
static | removePrintMediaDefinitionsFromStyleFile (string $path) |
|
static | removeWrongPathFromStyleFiles (string $path) |
|
static | getPurposeMap () |
|
static | getSelectionMap () |
|
static | getRenderers () |
|
static | updateRendererSelection (string $service, string $purpose, string $renderer) |
|
static | getRendererConfig (string $service, string $purpose, string $renderer) |
|
static | getRendererDefaultConfig (string $service, string $purpose, string $renderer) |
|
static | removeRendererConfig (string $service, string $purpose, string $renderer) |
|
static | getRendererInstance (string $renderer) |
|
static | saveRendererPurposeConfig (string $service, string $purpose, string $renderer, array $config) |
|
static | getRendererMapForPurpose (string $service, string $purpose) |
|
◆ getPurposeMap()
static ilPDFGeneratorUtils::getPurposeMap |
( |
| ) |
|
|
static |
◆ getRendererConfig()
static ilPDFGeneratorUtils::getRendererConfig |
( |
string |
$service, |
|
|
string |
$purpose, |
|
|
string |
$renderer |
|
) |
| |
|
static |
Definition at line 141 of file class.ilPDFGeneratorUtils.php.
References $DIC, $ilDB, and $query.
Referenced by ilObjPDFGenerationGUI\buildConfigForm(), and ilHtmlToPdfTransformerFactory\deliverPDFFromHTMLString().
144 $ilDB = $DIC->database();
146 $query =
'SELECT config FROM pdfgen_conf WHERE renderer = ' .
$ilDB->quote($renderer,
'text') .
147 ' AND service = ' .
$ilDB->quote(
$service,
'text') .
' AND purpose = ' .
$ilDB->quote($purpose,
'text');
150 if (
$ilDB->numRows($result) === 0) {
151 return self::getRendererDefaultConfig(
$service, $purpose, $renderer);
154 $row =
$ilDB->fetchAssoc($result);
155 return json_decode($row[
'config'],
true, 512, JSON_THROW_ON_ERROR);
◆ getRendererDefaultConfig()
static ilPDFGeneratorUtils::getRendererDefaultConfig |
( |
string |
$service, |
|
|
string |
$purpose, |
|
|
string |
$renderer |
|
) |
| |
|
static |
◆ getRendererInstance()
static ilPDFGeneratorUtils::getRendererInstance |
( |
string |
$renderer | ) |
|
|
static |
◆ getRendererMapForPurpose()
static ilPDFGeneratorUtils::getRendererMapForPurpose |
( |
string |
$service, |
|
|
string |
$purpose |
|
) |
| |
|
static |
◆ getRenderers()
static ilPDFGeneratorUtils::getRenderers |
( |
| ) |
|
|
static |
◆ getSelectionMap()
static ilPDFGeneratorUtils::getSelectionMap |
( |
| ) |
|
|
static |
◆ getTestPdfDir()
static ilPDFGeneratorUtils::getTestPdfDir |
( |
| ) |
|
|
static |
Definition at line 42 of file class.ilPDFGeneratorUtils.php.
References CLIENT_ID.
44 $iliasPDFTestPath =
'data/' .
CLIENT_ID .
'/pdf_service/';
45 if (!is_dir($iliasPDFTestPath) && !mkdir($iliasPDFTestPath) && !is_dir($iliasPDFTestPath)) {
46 throw new RuntimeException(sprintf(
'Directory "%s" was not created', $iliasPDFTestPath));
49 return $iliasPDFTestPath;
◆ isRendererPlugin()
static ilPDFGeneratorUtils::isRendererPlugin |
( |
string |
$path | ) |
|
|
staticprotected |
◆ prepareGenerationRequest()
static ilPDFGeneratorUtils::prepareGenerationRequest |
( |
string |
$service, |
|
|
string |
$purpose |
|
) |
| |
|
static |
Prepare the content processing for a PDF generation request This function should be called as in a request before any content is generated It sets the generation mode for Latex processing according the needs of the PDF renderer.
Definition at line 31 of file class.ilPDFGeneratorUtils.php.
References Vendor\Package\$e.
Referenced by ilTestExportGUI\createTestArchiveExport(), ilParticipantsTestResultsGUI\createUserResults(), ilTestServiceGUI\getQuestionResultForTestUsers(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserPassDetails(), ilTestEvaluationGUI\outUserResultsOverview(), ilTestSubmissionReviewGUI\pdfDownload(), ilObjTestGUI\printobject(), ilObjTestGUI\reviewobject(), and ilTestEvalObjectiveOrientedGUI\showVirtualPassCmd().
34 $map = self::getRendererMapForPurpose(
$service, $purpose);
35 $renderer = self::getRendererInstance($map[
'selected']);
36 $renderer->prepareGenerationRequest(
$service, $purpose);
◆ removePrintMediaDefinitionsFromStyleFile()
static ilPDFGeneratorUtils::removePrintMediaDefinitionsFromStyleFile |
( |
string |
$path | ) |
|
|
static |
Definition at line 52 of file class.ilPDFGeneratorUtils.php.
References $filename.
55 $content = file_get_contents($filename);
56 $content = preg_replace(
'/@media[\s]* print/',
'@media nothing', $content);
57 file_put_contents($filename, $content);
◆ removeRendererConfig()
static ilPDFGeneratorUtils::removeRendererConfig |
( |
string |
$service, |
|
|
string |
$purpose, |
|
|
string |
$renderer |
|
) |
| |
|
static |
◆ removeWrongPathFromStyleFiles()
static ilPDFGeneratorUtils::removeWrongPathFromStyleFiles |
( |
string |
$path | ) |
|
|
static |
Definition at line 61 of file class.ilPDFGeneratorUtils.php.
References $filename.
64 $content = file_get_contents($filename);
65 $content = preg_replace(
'/src:\surl\([\',\"](..\/)*(\S)/',
"src: url(./$2", $content);
66 file_put_contents($filename, $content);
◆ saveRendererPurposeConfig()
static ilPDFGeneratorUtils::saveRendererPurposeConfig |
( |
string |
$service, |
|
|
string |
$purpose, |
|
|
string |
$renderer, |
|
|
array |
$config |
|
) |
| |
|
static |
Definition at line 211 of file class.ilPDFGeneratorUtils.php.
References $DIC, $ilDB, $query, and $service.
Referenced by ilObjPDFGenerationGUI\saveConfig().
214 $ilDB = $DIC->database();
216 $query =
'DELETE FROM pdfgen_conf WHERE renderer = ' .
$ilDB->quote($renderer,
'text') .
217 ' AND service = ' .
$ilDB->quote(
$service,
'text') .
' AND purpose = ' .
$ilDB->quote($purpose,
'text');
224 'conf_id' => [
'integer',
$ilDB->nextId(
'pdfgen_conf')],
225 'renderer' => [
'text', $renderer],
227 'purpose' => [
'text', $purpose],
228 'config' => [
'clob', json_encode(
$config, JSON_THROW_ON_ERROR)]
◆ updateRendererSelection()
static ilPDFGeneratorUtils::updateRendererSelection |
( |
string |
$service, |
|
|
string |
$purpose, |
|
|
string |
$renderer |
|
) |
| |
|
static |
The documentation for this class was generated from the following file: