ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
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
}
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\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\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 Sat Jan 18 2025 19:01:26 for ILIAS by
1.8.13 (using
Doxyfile
)