ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ 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
s
t
w
+
Functions
_
a
b
c
f
g
h
i
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.ilADTExternalLink.php
Go to the documentation of this file.
1
<?php
2
3
class
ilADTExternalLink
extends
ilADT
4
{
5
const
MAX_LENGTH
= 500;
6
10
protected
$value
;
11
15
protected
$title
;
16
17
22
protected
function
isValidDefinition
(
ilADTDefinition
$a_def)
23
{
24
return
$a_def instanceof
ilADTExternalLinkDefinition
;
25
}
26
30
public
function
reset
()
31
{
32
parent::reset();
33
$this->value = null;
34
$this->title = null;
35
}
36
41
public
function
setTitle
($a_title = null)
42
{
43
if
($a_title !== null) {
44
$a_title = trim($a_title);
45
}
46
$this->title = $a_title;
47
}
48
53
public
function
getTitle
()
54
{
55
return
$this->title
;
56
}
57
62
public
function
setUrl
($a_value = null)
63
{
64
if
($a_value !== null) {
65
$a_value = trim($a_value);
66
}
67
$this->value = $a_value;
68
}
69
74
public
function
getUrl
()
75
{
76
return
$this->value
;
77
}
78
79
85
public
function
equals
(
ilADT
$a_adt)
86
{
87
if
($this->
getDefinition
()->isComparableTo($a_adt)) {
88
return
strcmp($this->
getCheckSum
(), $a_adt->
getCheckSum
()) === 0;
89
}
90
}
91
96
public
function
isLarger
(
ilADT
$a_adt)
97
{
98
}
99
104
public
function
isSmaller
(
ilADT
$a_adt)
105
{
106
}
107
112
public
function
isNull
()
113
{
114
return
(
bool
) !$this->
getLength
();
115
}
116
121
public
function
getLength
()
122
{
123
if
(function_exists(
"mb_strlen"
)) {
124
return
mb_strlen($this->
getUrl
() . $this->
getTitle
(),
"UTF-8"
);
125
}
else
{
126
return
strlen($this->
getUrl
() . $this->
getTitle
());
127
}
128
}
129
130
135
public
function
isValid
()
136
{
137
$valid
= parent::isValid();
138
139
if
(!$this->
isNull
()) {
140
if
(self::MAX_LENGTH < $this->
getLength
()) {
141
$valid
=
false
;
142
$this->
addValidationError
(self::ADT_VALIDATION_ERROR_MAX_LENGTH);
143
}
144
}
145
146
return
$valid
;
147
}
148
153
public
function
getCheckSum
()
154
{
155
if
(!$this->
isNull
()) {
156
return
md5($this->
getUrl
() . $this->
getTitle
());
157
}
158
}
159
160
164
public
function
exportStdClass
()
165
{
166
if
(!$this->
isNull
()) {
167
$obj =
new
stdClass();
168
$obj->url = $this->
getUrl
();
169
$obj->title = $this->
getTitle
();
170
171
return
$obj;
172
}
173
}
174
175
179
public
function
importStdClass
($a_std)
180
{
181
if
(is_object($a_std)) {
182
$this->
setTitle
($a_std->title);
183
$this->
setUrl
($a_std->url);
184
}
185
}
186
}
ilADTExternalLinkDefinition
Definition:
class.ilADTExternalLinkDefinition.php:3
ilADTExternalLink\MAX_LENGTH
const MAX_LENGTH
Definition:
class.ilADTExternalLink.php:5
ilADTExternalLink\isSmaller
isSmaller(ilADT $a_adt)
Is smaller.
Definition:
class.ilADTExternalLink.php:104
ilADTExternalLink\$title
$title
Definition:
class.ilADTExternalLink.php:15
$valid
$valid
Definition:
dummy_client.php:52
ilADT\addValidationError
addValidationError($a_error_code)
Add validation error code.
Definition:
class.ilADT.php:230
ilADTExternalLink\importStdClass
importStdClass($a_std)
Definition:
class.ilADTExternalLink.php:179
ilADTExternalLink\isLarger
isLarger(ilADT $a_adt)
Is larger.
Definition:
class.ilADTExternalLink.php:96
ilADTExternalLink\setTitle
setTitle($a_title=null)
Set title.
Definition:
class.ilADTExternalLink.php:41
ilADT
ADT base class.
Definition:
class.ilADT.php:11
ilADTExternalLink\getTitle
getTitle()
Getb title.
Definition:
class.ilADTExternalLink.php:53
ilADTExternalLink\getUrl
getUrl()
Get url.
Definition:
class.ilADTExternalLink.php:74
ilADTExternalLink\getCheckSum
getCheckSum()
get checksum
Definition:
class.ilADTExternalLink.php:153
ilADTExternalLink\reset
reset()
Reset.
Definition:
class.ilADTExternalLink.php:30
ilADTExternalLink\exportStdClass
exportStdClass()
Definition:
class.ilADTExternalLink.php:164
ilADTExternalLink\isValid
isValid()
is valid
Definition:
class.ilADTExternalLink.php:135
ilADTExternalLink\isNull
isNull()
is null
Definition:
class.ilADTExternalLink.php:112
ilADTExternalLink\setUrl
setUrl($a_value=null)
Set url.
Definition:
class.ilADTExternalLink.php:62
ilADTExternalLink\equals
equals(ilADT $a_adt)
Definition:
class.ilADTExternalLink.php:85
ilADTExternalLink\isValidDefinition
isValidDefinition(ilADTDefinition $a_def)
Definition:
class.ilADTExternalLink.php:22
ilADT\getCheckSum
getCheckSum()
Get unique checksum.
ilADTExternalLink\$value
$value
Definition:
class.ilADTExternalLink.php:10
ilADTDefinition
ADT definition base class.
Definition:
class.ilADTDefinition.php:11
ilADTExternalLink
Definition:
class.ilADTExternalLink.php:3
ilADTExternalLink\getLength
getLength()
Get length.
Definition:
class.ilADTExternalLink.php:121
ilADT\getDefinition
getDefinition()
Get definition.
Definition:
class.ilADT.php:97
Services
ADT
classes
Types
ExternalLink
class.ilADTExternalLink.php
Generated on Fri Apr 4 2025 20:01:17 for ILIAS by
1.8.13 (using
Doxyfile
)