74 $this->
lng = $DIC->language();
75 $this->tpl =
$DIC->ui()->mainTemplate();
76 $this->glyph_factory =
$DIC->ui()->factory()->symbol()->glyph();
77 $this->
renderer = $DIC->ui()->renderer();
78 $this->upload_limit =
$DIC[
'ui.upload_limit_resolver'];
82 $this->validationRegexp =
"";
88 $this->dodging_files =
new stdClass();
109 $this->suffixes = $a_suffixes;
201 $submittedElements = $this->
getInput();
203 if ($F && ((array) $this->dodging_files) !== []) {
204 $F = array_merge([self::FILE_DATA_INDEX_DODGING_FILE => (array) $this->dodging_files], $F);
207 if ($this->
getRequired() && !is_array($F[
'error'])) {
208 $this->
setAlert($this->
lng->txt(
"form_msg_file_no_upload"));
211 foreach ($F[
'error'] as $index => $error) {
215 case UPLOAD_ERR_FORM_SIZE:
216 case UPLOAD_ERR_INI_SIZE:
217 $this->
setAlert($this->
lng->txt(
"form_msg_file_size_exceeds"));
221 case UPLOAD_ERR_PARTIAL:
222 $this->
setAlert($this->
lng->txt(
"form_msg_file_partially_uploaded"));
226 case UPLOAD_ERR_NO_FILE:
229 } elseif (isset($F[self::FILE_DATA_INDEX_DODGING_FILE][$index]) && $F[self::FILE_DATA_INDEX_DODGING_FILE][$index] !==
'') {
232 $this->
setAlert($this->
lng->txt(
"form_msg_file_no_upload"));
236 case UPLOAD_ERR_NO_TMP_DIR:
237 $this->
setAlert($this->
lng->txt(
"form_msg_file_missing_tmp_dir"));
241 case UPLOAD_ERR_CANT_WRITE:
242 $this->
setAlert($this->
lng->txt(
"form_msg_file_cannot_write_to_disk"));
246 case UPLOAD_ERR_EXTENSION:
247 $this->
setAlert($this->
lng->txt(
"form_msg_file_upload_stopped_ext"));
255 if (is_array($F[
'tmp_name'])) {
256 foreach ($F[
'tmp_name'] as $index => $tmpname) {
260 $tmpname = array_shift($tmpname);
263 $suffix = $filename_arr[
"extension"] ??
'';
264 $mimetype = $F[
'type'][$index];
265 $size_bytes = $F[
'size'][$index];
267 if (strlen($tmpname) && is_array($this->
getSuffixes())) {
269 $this->
setAlert($this->
lng->txt(
"form_msg_file_wrong_file_type"));
276 foreach ($F[
'tmp_name'] as $index => $tmpname) {
280 $tmpname = array_shift($tmpname);
283 $suffix = $filename_arr[
"extension"] ??
'';
284 $mimetype = $F[
'type'][$index];
285 $size_bytes = $F[
'size'][$index];
287 if (strlen($tmpname)) {
289 if ($vir[0] ==
false) {
290 $this->
setAlert($this->
lng->txt(
"form_msg_file_virus_found") .
"<br />" . $vir[1]);
303 public function render(
string $a_mode =
""): string
334 $tpl->
setVariable(
'MAX_SIZE', $this->upload_limit->getPhpUploadLimitInBytes());
345 $this->glyph_factory->up()->withAction(
'#')
348 $this->glyph_factory->down()->withAction(
'#')
358 $this->glyph_factory->add()->withAction(
'#')
361 $this->glyph_factory->remove()->withAction(
'#')
370 $suff_str = $delim =
'';
372 $suff_str .= $delim .
'.' .
$suffix;
394$.extend({}, AnswerWizardInput, IdentifiedWizardInput).
init(
396 'fieldContainerSelector':
'.ilWzdContainerImage',
397 'reindexingRequiredElementsSelectors': [
398 'input:hidden[name*="[{$iterator_subfield_name}]"]',
399 'input:file[id*="__{$image_upload_subfield_name}__"]',
400 'input:submit[name*="[{$this->getImageUploadCommand()}]"]',
401 'input:submit[name*="[{$this->getImageRemovalCommand()}]"]',
404 'handleRowCleanUpCallback':
function(rowElem) {
405 $(rowElem).find(
'div.imagepresentation').remove();
406 $(rowElem).find(
'input[type=text]').val(
'');
412 $this->tpl->addJavascript(
"assets/js/answerwizardinput.js");
413 $this->tpl->addJavascript(
"assets/js/identifiedwizardinput.js");
414 $this->tpl->addOnLoadCode($init_code);
427 && array_key_exists(
'src',
$value)
450 return isset(
$value[
'title']) && strlen(
$value[
'title']);
467 return new ilTemplate(self::RENDERING_TEMPLATE,
true,
true,
"components/ILIAS/TestQuestionPool");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
This is how a factory for glyphs looks like.
An entity that renders components to a string output.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc