ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
class.ilUriInputGUI.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
ILIAS\Data\URI
;
22
29
class
ilUriInputGUI
extends
ilTextInputGUI
30
{
31
protected
?
int
$maxlength
= 500;
32
protected
int
$size
= 40;
33
34
public
function
__construct
(
35
string
$a_title =
""
,
36
string
$a_postvar =
""
37
) {
38
global
$DIC
;
39
40
$this->
lng
= $DIC->language();
41
parent::__construct
($a_title, $a_postvar);
42
$this->
setType
(
"uri"
);
43
}
44
45
public
function
checkInput
(): bool
46
{
47
$lng
=
$this->lng
;
48
49
$uri_string = trim($this->
getInput
());
50
51
// check required
52
if
($uri_string ===
""
) {
53
if
($this->
getRequired
()) {
54
$this->
setAlert
(
$lng
->
txt
(
"msg_input_is_required"
));
55
return
false
;
56
}
57
return
true
;
58
}
59
60
try
{
61
new
URI
($uri_string);
62
}
catch
(
Throwable
$e
) {
63
$this->
setAlert
(
$lng
->
txt
(
"form_invalid_uri"
));
64
return
false
;
65
}
66
67
return
true
;
68
}
69
}
ilLanguage\txt
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Definition:
class.ilLanguage.php:170
ilFormPropertyGUI\setAlert
setAlert(string $a_alert)
Definition:
class.ilFormPropertyGUI.php:146
Vendor\Package\$e
$e
Definition:
example_cleaned.php:49
ilUriInputGUI\$maxlength
int $maxlength
Definition:
class.ilUriInputGUI.php:31
ilFormPropertyGUI\setType
setType(string $a_type)
Definition:
class.ilFormPropertyGUI.php:99
ilUriInputGUI\$size
int $size
Definition:
class.ilUriInputGUI.php:32
ILIAS\Repository\lng
lng()
Definition:
trait.GlobalDICDomainServices.php:61
$DIC
global $DIC
Definition:
shib_login.php:26
ilUriInputGUI
Legacy Uri input.
Definition:
class.ilUriInputGUI.php:29
ilTextInputGUI
ilTextInputGUI\getInput
getInput()
Definition:
class.ilTextInputGUI.php:226
ILIAS\Data\URI
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
Definition:
PluginProviderHelper.php:37
ilFormPropertyGUI\getRequired
getRequired()
Definition:
class.ilFormPropertyGUI.php:161
ilFormPropertyGUI\$lng
ilLanguage $lng
Definition:
class.ilFormPropertyGUI.php:37
ilUriInputGUI\checkInput
checkInput()
Definition:
class.ilUriInputGUI.php:45
ilUriInputGUI\__construct
__construct(string $a_title="", string $a_postvar="")
Definition:
class.ilUriInputGUI.php:34
Throwable
components
ILIAS
Form
classes
class.ilUriInputGUI.php
Generated on Sun Aug 31 2025 23:03:00 for ILIAS by
1.8.13 (using
Doxyfile
)