ILIAS
release_8 Revision v8.19
◀ 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
n
o
p
r
s
t
u
v
w
x
+
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
j
l
m
p
s
t
u
+
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
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilRepoStandardUploadHandlerGUI.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
21
use
ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
;
22
use
ILIAS\FileUpload\Handler\FileInfoResult
;
23
use
ILIAS\FileUpload\Handler\HandlerResult
;
24
use
ILIAS\UI\Component\Dropzone\File\Wrapper
;
25
use
ILIAS\FileUpload\Location
;
26
use
ILIAS\FileUpload\Handler\BasicFileInfoResult
;
27
use
ILIAS\FileUpload\Handler\BasicHandlerResult
;
28
use
ILIAS\UI\Component\Input\Field\Group
;
29
33
class
ilRepoStandardUploadHandlerGUI
extends
AbstractCtrlAwareUploadHandler
34
{
35
protected
?
ilLogger
$log
= null;
36
protected
Closure
$result_handler
;
37
protected
string
$file_id_parameter
=
""
;
38
39
public
function
__construct
(
40
Closure
$result_handler,
41
string
$file_id_parameter,
42
string
$logger_id =
""
43
) {
44
global
$DIC
;
45
parent::__construct
();
46
47
if
($logger_id !==
""
) {
48
$this->log =
ilLoggerFactory::getLogger
($logger_id);
49
}
50
$this->result_handler =
$result_handler
;
51
$this->file_id_parameter =
$file_id_parameter
;
52
}
53
54
protected
function
debug
(
string
$mess): void
55
{
56
if
(!is_null($this->log)) {
57
$this->log->debug($mess);
58
}
59
}
60
61
protected
function
getUploadResult
():
HandlerResult
62
{
63
$this->
debug
(
"checking for uploads..."
);
64
if
($this->
upload
->hasUploads()) {
65
$this->
debug
(
"has upload..."
);
66
try
{
67
$this->
upload
->process();
68
$this->
debug
(
"nr of results: "
. count($this->
upload
->getResults()));
69
foreach
($this->
upload
->getResults(
70
) as $result) {
// in this version, there will only be one upload at the time
71
72
$rh =
$this->result_handler
;
73
$result = $rh($this->
upload
, $result);
74
75
/*
76
$result = new BasicHandlerResult(
77
$this->getFileIdentifierParameterName(),
78
BasicHandlerResult::STATUS_OK,
79
$id,
80
''
81
);*/
82
}
83
}
catch
(
Exception
$e
) {
84
$result =
new
BasicHandlerResult
(
85
$this->
getFileIdentifierParameterName
(),
86
BasicHandlerResult::STATUS_FAILED,
87
''
,
88
$e->getMessage()
89
);
90
}
91
$this->
debug
(
"end of 'has_uploads'"
);
92
}
else
{
93
$this->
debug
(
"has no upload..."
);
94
}
95
96
return
$result;
97
}
98
99
protected
function
getRemoveResult
(
string
$identifier):
HandlerResult
100
{
101
return
new
BasicHandlerResult
(
102
$this->
getFileIdentifierParameterName
(),
103
HandlerResult::STATUS_OK,
104
$identifier,
105
''
106
);
107
}
108
109
public
function
getInfoResult
(
string
$identifier): ?
FileInfoResult
110
{
111
return
null;
112
}
113
114
public
function
getInfoForExistingFiles
(array $file_ids): array
115
{
116
return
[];
117
}
118
119
public
function
getFileIdentifierParameterName
(): string
120
{
121
return
$this->file_id_parameter
;
122
}
123
}
ilLogger
ilLoggerFactory\getLogger
static getLogger(string $a_component_id)
Get component logger.
Definition:
class.ilLoggerFactory.php:89
ilRepoStandardUploadHandlerGUI\getInfoResult
getInfoResult(string $identifier)
Definition:
class.ilRepoStandardUploadHandlerGUI.php:109
BasicHandlerResult
Closure
Vendor\Package\$e
$e
Definition:
example_cleaned.php:49
ilRepoStandardUploadHandlerGUI\$file_id_parameter
string $file_id_parameter
Definition:
class.ilRepoStandardUploadHandlerGUI.php:37
Location
BasicFileInfoResult
AbstractCtrlAwareUploadHandler
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilRepoStandardUploadHandlerGUI
Definition:
class.ilRepoStandardUploadHandlerGUI.php:33
$DIC
global $DIC
Definition:
feed.php:28
ilRepoStandardUploadHandlerGUI\getRemoveResult
getRemoveResult(string $identifier)
Definition:
class.ilRepoStandardUploadHandlerGUI.php:99
ilRepoStandardUploadHandlerGUI\getUploadResult
getUploadResult()
Definition:
class.ilRepoStandardUploadHandlerGUI.php:61
ilRepoStandardUploadHandlerGUI\debug
debug(string $mess)
Definition:
class.ilRepoStandardUploadHandlerGUI.php:54
ILIAS\UI\Implementation\Component\Input\Group
trait Group
Definition:
Group.php:34
ilRepoStandardUploadHandlerGUI\$log
ilLogger $log
Definition:
class.ilRepoStandardUploadHandlerGUI.php:35
FileInfoResult
Wrapper
HandlerResult
ILIAS\FileUpload\Handler\BasicHandlerResult
Class BasicHandlerResult.
Definition:
BasicHandlerResult.php:25
ILIAS\FileUpload\Handler\HandlerResult
Interface HandlerResult.
Definition:
HandlerResult.php:27
ILIAS\FileUpload\Handler\FileInfoResult
Interface FileInfoResult.
Definition:
FileInfoResult.php:30
ilRepoStandardUploadHandlerGUI\$result_handler
Closure $result_handler
Definition:
class.ilRepoStandardUploadHandlerGUI.php:36
ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
Class ilCtrlAwareUploadHandler.
Definition:
AbstractCtrlAwareUploadHandler.php:30
ilRepoStandardUploadHandlerGUI\getInfoForExistingFiles
getInfoForExistingFiles(array $file_ids)
Definition:
class.ilRepoStandardUploadHandlerGUI.php:114
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
Definition:
PluginProviderHelper.php:37
ilRepoStandardUploadHandlerGUI\__construct
__construct(Closure $result_handler, string $file_id_parameter, string $logger_id="")
Definition:
class.ilRepoStandardUploadHandlerGUI.php:39
ILIAS\Repository\upload
upload()
Definition:
trait.GlobalDICGUIServices.php:72
ilRepoStandardUploadHandlerGUI\getFileIdentifierParameterName
getFileIdentifierParameterName()
Definition:
class.ilRepoStandardUploadHandlerGUI.php:119
Exception
Services
Repository
Service
Form
class.ilRepoStandardUploadHandlerGUI.php
Generated on Tue Apr 1 2025 22:02:32 for ILIAS by
1.8.13 (using
Doxyfile
)