ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
class.ilPCLegacyAnswerFormText.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
class
ilPCLegacyAnswerFormText
extends
ilPageContent
22
{
23
private
const
string
ELEMENT_TAG
=
'LegacyAnswerFormText'
;
24
private
const
string
TEXT_ATTRIBUTE
=
'Text'
;
25
private
const
string
TEXT_PLACEHOLDER
=
'\[\[\[LEGACY_ANSWER_FORM_TEXT_((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?)\]\]\]'
;
26
27
public
function
init
(): void
28
{
29
$this->
setType
(
'laft'
);
30
}
31
32
#[\Override]
33
public
function
modifyPageContentPostXsl
(
34
string
$output,
35
string
$mode,
36
bool
$abstract_only =
false
37
): string {
38
if
($this->pg_obj::class !==
QstsQuestionPage
::class) {
39
return
$output;
40
}
41
42
return
mb_ereg_replace_callback(
43
self::TEXT_PLACEHOLDER,
44
static
fn(array $matches):
string
=> \
ilRTE::_replaceMediaObjectImageSrc
(
45
base64_decode($matches[1])
46
),
47
$output
48
);
49
}
50
51
public
function
create
(
52
string
$legacy_answer_form_text
53
): void {
54
$this->createInitialChildNode(
55
$this->hier_id,
56
''
,
57
self::ELEMENT_TAG,
58
[self::TEXT_ATTRIBUTE => $legacy_answer_form_text]
59
);
60
}
61
}
QstsQuestionPage
Definition:
QstsQuestionPage.php:30
ilPCLegacyAnswerFormText
Definition:
class.ilPCLegacyAnswerFormText.php:22
ilPCLegacyAnswerFormText\TEXT_ATTRIBUTE
const string TEXT_ATTRIBUTE
Definition:
class.ilPCLegacyAnswerFormText.php:24
ilPCLegacyAnswerFormText\create
create(string $legacy_answer_form_text)
Definition:
class.ilPCLegacyAnswerFormText.php:51
ilPCLegacyAnswerFormText\init
init()
Init object.
Definition:
class.ilPCLegacyAnswerFormText.php:27
ilPCLegacyAnswerFormText\TEXT_PLACEHOLDER
const string TEXT_PLACEHOLDER
Definition:
class.ilPCLegacyAnswerFormText.php:25
ilPCLegacyAnswerFormText\modifyPageContentPostXsl
modifyPageContentPostXsl(string $output, string $mode, bool $abstract_only=false)
Modify page content after xsl.
Definition:
class.ilPCLegacyAnswerFormText.php:33
ilPCLegacyAnswerFormText\ELEMENT_TAG
const string ELEMENT_TAG
Definition:
class.ilPCLegacyAnswerFormText.php:23
ilPageContent
Content object of ilPageObject (see ILIAS DTD).
Definition:
class.ilPageContent.php:29
ilPageContent\setType
setType(string $a_type)
Set Type.
Definition:
class.ilPageContent.php:103
ilRTE\_replaceMediaObjectImageSrc
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
Definition:
class.ilRTE.php:228
if
if(!file_exists('../ilias.ini.php'))
Definition:
sessioncheck.php:24
components
ILIAS
Questions
Legacy
PageEditor
class.ilPCLegacyAnswerFormText.php
Generated on Wed Nov 11 2026 23:08:38 for ILIAS by
1.9.4 (using
Doxyfile
)