ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilADTLocalizedText.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8
class
ilADTLocalizedText
extends
ilADTText
9
{
13
private
$translations
= [];
14
18
public
function
getTextForLanguage
(
string
$language)
19
{
20
if
(strlen($this->
getTranslations
()[$language])) {
21
return
$this->
getTranslations
()[$language];
22
}
23
return
$this->
getText
();
24
}
25
29
public
function
getTranslations
()
30
{
31
return
$this->translations
;
32
}
33
38
public
function
setTranslation
(
string
$language,
string
$translation)
39
{
40
$this->translations[$language] = $translation;
41
}
42
46
protected
function
isValidDefinition
(
ilADTDefinition
$a_def)
47
{
48
return
$a_def instanceof
ilADTLocalizedTextDefinition
;
49
}
50
54
public
function
equals
(
ilADT
$adt)
55
{
56
if
(!$this->
getDefinition
()->isComparableTo($adt)) {
57
return
false
;
58
}
59
if
(count($this->
getTranslations
()) != count($adt->getTranslations())) {
60
return
false
;
61
}
62
foreach
($adt->getTranslations() as $key =>
$value
) {
63
if
(!isset($this->
getTranslations
()[$key])) {
64
return
false
;
65
}
66
if
(!strcmp($this->
getTranslations
()[$key],
$value
)) {
67
return
false
;
68
}
69
}
70
return
true
;
71
}
72
76
public
function
isLarger
(
ilADT
$a_adt)
77
{
78
}
79
83
public
function
isSmaller
(
ilADT
$a_adt)
84
{
85
}
86
90
public
function
isNull
()
91
{
92
return
!$this->
getLength
() && !count($this->
getTranslations
());
93
}
94
98
public
function
getCheckSum
()
99
{
100
return
md5(serialize($this->
getTranslations
()));
101
}
102
106
public
function
exportStdClass
()
107
{
108
if
(!$this->
isNull
()) {
109
$obj =
new
stdClass
();
110
$obj->translations = $this->
getTranslations
();
111
return
$obj;
112
}
113
}
114
118
public
function
importStdClass
($a_std)
119
{
120
if
(is_object($a_std)) {
121
$this->translations = $a_std->translations;
122
}
123
}
124
}
ilADTLocalizedText\equals
equals(ilADT $adt)
Definition:
class.ilADTLocalizedText.php:54
ilADTLocalizedText\isValidDefinition
isValidDefinition(ilADTDefinition $a_def)
Definition:
class.ilADTLocalizedText.php:46
ilADTText\$value
$value
Definition:
class.ilADTText.php:5
ilADTLocalizedText\isLarger
isLarger(ilADT $a_adt)
Definition:
class.ilADTLocalizedText.php:76
ilADT
ADT base class.
Definition:
class.ilADT.php:11
ilADTLocalizedText
Class ilADTLocalizedText.
Definition:
class.ilADTLocalizedText.php:8
ilADTLocalizedText\setTranslation
setTranslation(string $language, string $translation)
Definition:
class.ilADTLocalizedText.php:38
ilADTLocalizedText\isSmaller
isSmaller(ilADT $a_adt)
Definition:
class.ilADTLocalizedText.php:83
ilADTText\getText
getText()
Definition:
class.ilADTText.php:33
ilADTLocalizedText\getCheckSum
getCheckSum()
Definition:
class.ilADTLocalizedText.php:98
ilADTLocalizedText\getTextForLanguage
getTextForLanguage(string $language)
Definition:
class.ilADTLocalizedText.php:18
ilADTLocalizedText\getTranslations
getTranslations()
Definition:
class.ilADTLocalizedText.php:29
ilADTText
Definition:
class.ilADTText.php:3
ilADTLocalizedText\$translations
$translations
Definition:
class.ilADTLocalizedText.php:13
ilADTDefinition
ADT definition base class.
Definition:
class.ilADTDefinition.php:11
ilADTLocalizedTextDefinition
Class ilADTLocalizedText.
Definition:
class.ilADTLocalizedTextDefinition.php:8
ilADTLocalizedText\importStdClass
importStdClass($a_std)
Definition:
class.ilADTLocalizedText.php:118
ilADTLocalizedText\isNull
isNull()
Definition:
class.ilADTLocalizedText.php:90
ilADTLocalizedText\exportStdClass
exportStdClass()
Definition:
class.ilADTLocalizedText.php:106
stdClass
ilADTText\getLength
getLength()
Definition:
class.ilADTText.php:38
ilADT\getDefinition
getDefinition()
Get definition.
Definition:
class.ilADT.php:97
Services
ADT
classes
Types
LocalizedText
class.ilADTLocalizedText.php
Generated on Wed Apr 16 2025 21:01:02 for ILIAS by
1.8.13 (using
Doxyfile
)