76 $this->
lng = $DIC->language();
77 $this->tpl =
$DIC->ui()->mainTemplate();
78 $this->glyph_factory =
$DIC->ui()->factory()->symbol()->glyph();
79 $this->button_factory =
$DIC->ui()->factory()->button();
80 $this->
renderer = $DIC->ui()->renderer();
81 $this->upload_limit =
$DIC[
'ui.upload_limit_resolver'];
85 $this->validationRegexp =
"";
91 $this->dodging_files =
new stdClass();
101 $manipulator->setPostVar($this->
getPostVar());
112 $this->suffixes = $a_suffixes;
204 $submittedElements = $this->
getInput();
206 if ($F && ((array) $this->dodging_files) !== []) {
207 $F = array_merge([self::FILE_DATA_INDEX_DODGING_FILE => (array) $this->dodging_files], $F);
210 if ($this->
getRequired() && !is_array($F[
'error'])) {
211 $this->
setAlert($this->
lng->txt(
"form_msg_file_no_upload"));
214 foreach ($F[
'error'] as $index => $error) {
218 case UPLOAD_ERR_FORM_SIZE:
219 case UPLOAD_ERR_INI_SIZE:
220 $this->
setAlert($this->
lng->txt(
"form_msg_file_size_exceeds"));
224 case UPLOAD_ERR_PARTIAL:
225 $this->
setAlert($this->
lng->txt(
"form_msg_file_partially_uploaded"));
229 case UPLOAD_ERR_NO_FILE:
232 } elseif (isset($F[self::FILE_DATA_INDEX_DODGING_FILE][$index]) && $F[self::FILE_DATA_INDEX_DODGING_FILE][$index] !==
'') {
235 $this->
setAlert($this->
lng->txt(
"form_msg_file_no_upload"));
239 case UPLOAD_ERR_NO_TMP_DIR:
240 $this->
setAlert($this->
lng->txt(
"form_msg_file_missing_tmp_dir"));
244 case UPLOAD_ERR_CANT_WRITE:
245 $this->
setAlert($this->
lng->txt(
"form_msg_file_cannot_write_to_disk"));
249 case UPLOAD_ERR_EXTENSION:
250 $this->
setAlert($this->
lng->txt(
"form_msg_file_upload_stopped_ext"));
258 if (is_array($F[
'tmp_name'])) {
259 foreach ($F[
'tmp_name'] as $index => $tmpname) {
263 $tmpname = array_shift($tmpname);
266 $suffix = $filename_arr[
"extension"] ??
'';
267 $mimetype = $F[
'type'][$index];
268 $size_bytes = $F[
'size'][$index];
270 if (strlen($tmpname) && is_array($this->
getSuffixes())) {
272 $this->
setAlert($this->
lng->txt(
"form_msg_file_wrong_file_type"));
279 foreach ($F[
'tmp_name'] as $index => $tmpname) {
283 $tmpname = array_shift($tmpname);
286 $suffix = $filename_arr[
"extension"] ??
'';
287 $mimetype = $F[
'type'][$index];
288 $size_bytes = $F[
'size'][$index];
290 if (strlen($tmpname)) {
292 if ($vir[0] ==
false) {
293 $this->
setAlert($this->
lng->txt(
"form_msg_file_virus_found") .
"<br />" . $vir[1]);
306 public function render(
string $a_mode =
""): string
337 $tpl->
setVariable(
'MAX_SIZE', $this->upload_limit->getPhpUploadLimitInBytes());
348 $this->button_factory->shy(
'',
'')->withSymbol($this->glyph_factory->up())
351 $this->button_factory->shy(
'',
'')->withSymbol($this->glyph_factory->down())
361 $this->button_factory->shy(
'',
'')->withSymbol($this->glyph_factory->add())
364 $this->button_factory->shy(
'',
'')->withSymbol($this->glyph_factory->remove())
373 $suff_str = $delim =
'';
375 $suff_str .= $delim .
'.' .
$suffix;
397$.extend({}, AnswerWizardInput, IdentifiedWizardInput).
init(
399 'fieldContainerSelector':
'.ilWzdContainerImage',
400 'reindexingRequiredElementsSelectors': [
401 'input:hidden[name*="[{$iterator_subfield_name}]"]',
402 'input:file[id*="__{$image_upload_subfield_name}__"]',
403 'input:submit[name*="[{$this->getImageUploadCommand()}]"]',
404 'input:submit[name*="[{$this->getImageRemovalCommand()}]"]',
407 'handleRowCleanUpCallback':
function(rowElem) {
408 $(rowElem).find(
'div.imagepresentation').remove();
409 $(rowElem).find(
'input[type=text]').val(
'');
415 $this->tpl->addJavascript(
"assets/js/answerwizardinput.js");
416 $this->tpl->addJavascript(
"assets/js/identifiedwizardinput.js");
417 $this->tpl->addOnLoadCode($init_code);
430 && array_key_exists(
'src',
$value)
453 return isset(
$value[
'title']) && strlen(
$value[
'title']);
470 return new ilTemplate(self::RENDERING_TEMPLATE,
true,
true,
"components/ILIAS/TestQuestionPool");
Builds a Color from either hex- or rgb values.
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