ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMultipleImagesInputGUI Class Reference
+ Inheritance diagram for ilMultipleImagesInputGUI:
+ Collaboration diagram for ilMultipleImagesInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setSuffixes ($a_suffixes)
 Set Accepted Suffixes. More...
 
 getSuffixes ()
 Get Accepted Suffixes. More...
 
 getImageRemovalCommand ()
 
 setImageRemovalCommand ($imageRemovalCommand)
 
 getImageUploadCommand ()
 
 setImageUploadCommand ($imageUploadCommand)
 
 isEditElementOccuranceEnabled ()
 
 setEditElementOccuranceEnabled ($editElementOccuranceEnabled)
 
 isEditElementOrderEnabled ()
 
 setEditElementOrderEnabled ($editElementOrderEnabled)
 
 onCheckInput ()
 Check input, strip slashes etc. More...
 
 render ($a_mode="")
 
- Public Member Functions inherited from ilIdentifiedMultiValuesInputGUI
 __construct ($a_title="", $a_postvar="")
 
 getElementAddCmd ()
 
 setElementAddCmd ($elementAddCmd)
 
 getElementRemoveCmd ()
 
 setElementRemoveCmd ($elementRemoveCmd)
 
 getElementMoveUpCommand ()
 
 setElementMoveUpCommand ($elementMoveUpCommand)
 
 getElementMoveDownCommand ()
 
 setElementMoveDownCommand ($elementMoveDownCommand)
 
 setValues ($values)
 
 getValues ()
 
 setValue ($value)
 
 getValue ()
 
 setMultiValues (array $values)
 
 getMultiValues ()
 
 setIdentifiedMultiValues ($values)
 
 getIdentifiedMultiValues ()
 
 setValueByArray ($a_values)
 
 checkInput ()
 
 onCheckInput ()
 
 prepareReprintable (assQuestion $question)
 
- Public Member Functions inherited from ilTextInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure. More...
 
 getValidationFailureMessage ()
 
 setValidationRegexp ($a_value)
 Set validation regexp. More...
 
 getValidationRegexp ()
 Get validation regexp. More...
 
 setMaxLength ($a_maxlength)
 Set Max Length. More...
 
 getMaxLength ()
 Get Max Length. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setInlineStyle ($a_style)
 Set inline style. More...
 
 getInlineStyle ()
 Get inline style. More...
 
 setCssClass ($a_class)
 
 getCssClass ()
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 setSuffix ($a_value)
 Set suffix. More...
 
 getSuffix ()
 Get suffix. More...
 
 setInputType ($a_type)
 set input type More...
 
 getInputType ()
 get input type More...
 
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter. More...
 
 getSubmitFormOnEnter ()
 Get submit form on enter. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getDataSource ()
 get datasource link for js autocomplete More...
 
 setDataSource ($href, $a_delimiter=null)
 set datasource link for js autocomplete More...
 
 setDataSourceSubmitOnSelection ($a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl ($a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 
 insert ($a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 setDisableHtmlAutoComplete ($autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 

Data Fields

const RENDERING_TEMPLATE = 'tpl.prop_multi_image_inp.html'
 
const ITERATOR_SUBFIELD_NAME = 'iteratorfield'
 
const STORED_IMAGE_SUBFIELD_NAME = 'storedimage'
 
const IMAGE_UPLOAD_SUBFIELD_NAME = 'imageupload'
 
const FILE_DATA_INDEX_DODGING_FILE = 'dodging_file'
 
- Data Fields inherited from ilIdentifiedMultiValuesInputGUI
const ELEMENT_DEFAULT_ADD_CMD = 'addElement'
 
const ELEMENT_DEFAULT_REMOVE_CMD = 'removeElement'
 
const ELEMENT_DEFAULT_MOVE_UP_CMD = 'moveUpElement'
 
const ELEMENT_DEFAULT_MOVE_DOWN_CMD = 'moveDownElement'
 

Protected Member Functions

 isValidFilenameInput ($filenameInput)
 
 valueHasContentImageSource ($value)
 
 fetchContentImageSourceFromValue ($value)
 
 valueHasContentImageTitle ($value)
 
 fetchContentImageTitleFromValue ($value)
 
 getTemplate ()
 
- Protected Member Functions inherited from ilIdentifiedMultiValuesInputGUI
 getMultiValueSubFieldId ($identifier, $subFieldIndex)
 
 getMultiValuePosIndexedFieldId ($identifier, $positionIndex)
 
 getMultiValuePosIndexedSubFieldId ($identifier, $subFieldIndex, $positionIndex)
 
 getFieldIdFromPostVar ($tempPostVar)
 
 getPostVarSubField ($subFieldIndex)
 
 getMultiValuePostVarSubField ($identifier, $subFieldIndex)
 
 getMultiValuePostVarSubFieldPosIndexed ($identifier, $subFieldIndex, $positionIndex)
 
 getMultiValuePostVarPosIndexed ($identifier, $positionIndex)
 
 getMultiValuePostVar ($identifier)
 
 buildMultiValueSubmitVar ($identifier, $positionIndex, $submitCommand)
 
 setIdentifiedMultiValuesByArray ($a_values)
 
 prepareMultiValuesInput ($values)
 
 prepareMultiValuesSubmit ($values)
 
 getFormValuesManipulators ()
 
 addFormValuesManipulator (ilFormValuesManipulator $manipulator)
 
 getSubFieldCompletedPostVar ($subFieldIndex, $elemPostVar)
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Protected Attributes

 $editElementOccuranceEnabled = false
 
 $editElementOrderEnabled = false
 
 $suffixes = array()
 
 $imageRemovalCommand = 'removeImage'
 
 $imageUploadCommand = 'uploadImage'
 
- Protected Attributes inherited from ilIdentifiedMultiValuesInputGUI
 $elementAddCmd = self::ELEMENT_DEFAULT_ADD_CMD
 
 $elementRemoveCmd = self::ELEMENT_DEFAULT_REMOVE_CMD
 
 $elementMoveUpCommand = self::ELEMENT_DEFAULT_MOVE_UP_CMD
 
 $elementMoveDownCommand = self::ELEMENT_DEFAULT_MOVE_DOWN_CMD
 
 $identified_multi_values = array()
 
 $formValuesManipulationChain = array()
 
- Protected Attributes inherited from ilTextInputGUI
 $value
 
 $maxlength = 200
 
 $size = 40
 
 $validationRegexp
 
 $validationFailureMessage = ''
 
 $suffix
 
 $style_css
 
 $css_class
 
 $ajax_datasource
 
 $ajax_datasource_delimiter
 
 $ajax_datasource_commit = FALSE
 
 $ajax_datasource_commit_url
 
 $submit_form_on_enter = false
 
 $autocomplete_disabled = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Detailed Description

Definition at line 13 of file class.ilMultipleImagesInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMultipleImagesInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Definition at line 47 of file class.ilMultipleImagesInputGUI.php.

References ilIdentifiedMultiValuesInputGUI\addFormValuesManipulator(), array, ilFormPropertyGUI\getPostVar(), ilTextInputGUI\setSize(), and setSuffixes().

48  {
49  parent::__construct($a_title, $a_postvar);
50 
51  $this->setSuffixes(array("jpg", "jpeg", "png", "gif"));
52  $this->setSize('25');
53  $this->validationRegexp = "";
54 
55  require_once 'Services/Form/classes/class.ilMultipleImagesAdditionalIndexLevelRemover.php';
57  $manipulator->setPostVar($this->getPostVar());
58  $this->addFormValuesManipulator($manipulator);
59 
60  require_once 'Services/Form/classes/class.ilMultipleImagesFileSubmissionDataCompletion.php';
62  $manipulator->setPostVar($this->getPostVar());
63  $this->addFormValuesManipulator($manipulator);
64 
65  require_once 'Services/Form/classes/class.ilIdentifiedMultiFilesJsPositionIndexRemover.php';
67  $manipulator->setPostVar($this->getPostVar());
68  $this->addFormValuesManipulator($manipulator);
69 
70  require_once 'Services/Form/classes/class.ilMultiFilesSubmitRecursiveSlashesStripper.php';
71  $manipulator = new ilMultiFilesSubmitRecursiveSlashesStripper();
72  $manipulator->setPostVar($this->getPostVar());
73  $this->addFormValuesManipulator($manipulator);
74  }
getPostVar()
Get Post Variable.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
setSize($a_size)
Set Size.
Create styles array
The data for the language used.
addFormValuesManipulator(ilFormValuesManipulator $manipulator)
+ Here is the call graph for this function:

Member Function Documentation

◆ fetchContentImageSourceFromValue()

ilMultipleImagesInputGUI::fetchContentImageSourceFromValue (   $value)
protected
Parameters
$value
Returns
string

Definition at line 401 of file class.ilMultipleImagesInputGUI.php.

References ilTextInputGUI\$value, and valueHasContentImageSource().

Referenced by fetchContentImageTitleFromValue(), and render().

402  {
403  if( $this->valueHasContentImageSource($value) )
404  {
405  return $value['src'];
406  }
407 
408  return null;
409  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchContentImageTitleFromValue()

ilMultipleImagesInputGUI::fetchContentImageTitleFromValue (   $value)
protected
Parameters
string$value

Definition at line 423 of file class.ilMultipleImagesInputGUI.php.

References ilTextInputGUI\$value, fetchContentImageSourceFromValue(), and valueHasContentImageTitle().

Referenced by render().

424  {
425  if( $this->valueHasContentImageTitle($value) )
426  {
427  return $value['title'];
428  }
429 
431  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageRemovalCommand()

ilMultipleImagesInputGUI::getImageRemovalCommand ( )
Returns
string

Definition at line 99 of file class.ilMultipleImagesInputGUI.php.

References $imageRemovalCommand.

Referenced by render().

+ Here is the caller graph for this function:

◆ getImageUploadCommand()

ilMultipleImagesInputGUI::getImageUploadCommand ( )
Returns
string

Definition at line 115 of file class.ilMultipleImagesInputGUI.php.

References $imageUploadCommand.

Referenced by render().

+ Here is the caller graph for this function:

◆ getSuffixes()

ilMultipleImagesInputGUI::getSuffixes ( )

Get Accepted Suffixes.

Returns
array Accepted Suffixes

Definition at line 91 of file class.ilMultipleImagesInputGUI.php.

References $suffixes.

Referenced by onCheckInput(), and render().

+ Here is the caller graph for this function:

◆ getTemplate()

ilMultipleImagesInputGUI::getTemplate ( )
protected
Returns
ilTemplate

Definition at line 436 of file class.ilMultipleImagesInputGUI.php.

Referenced by render().

437  {
438  return new ilTemplate(self::RENDERING_TEMPLATE, true, true, "Services/Form");
439  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ isEditElementOccuranceEnabled()

ilMultipleImagesInputGUI::isEditElementOccuranceEnabled ( )
Returns
boolean $editElementOccuranceEnabled

Definition at line 131 of file class.ilMultipleImagesInputGUI.php.

References $editElementOccuranceEnabled.

Referenced by render().

+ Here is the caller graph for this function:

◆ isEditElementOrderEnabled()

ilMultipleImagesInputGUI::isEditElementOrderEnabled ( )
Returns
boolean

Definition at line 147 of file class.ilMultipleImagesInputGUI.php.

References $editElementOrderEnabled.

Referenced by render().

+ Here is the caller graph for this function:

◆ isValidFilenameInput()

ilMultipleImagesInputGUI::isValidFilenameInput (   $filenameInput)
abstractprotected
Parameters
mixed$value
Returns
bool

Referenced by setEditElementOrderEnabled().

+ Here is the caller graph for this function:

◆ onCheckInput()

ilMultipleImagesInputGUI::onCheckInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean $validationSuccess

Definition at line 171 of file class.ilMultipleImagesInputGUI.php.

References $error, $filename, $GLOBALS, $lng, ilTextInputGUI\$suffix, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getSuffixes(), ilFormPropertyGUI\setAlert(), and ilUtil\virusHandling().

172  {
173  $lng = $GLOBALS['DIC'] ? $GLOBALS['DIC']['lng'] : $GLOBALS['lng'];
174  $F = $_FILES[$this->getPostVar()];
175 
176  if( $this->getRequired() && !is_array($F['error']) )
177  {
178  $this->setAlert($lng->txt("form_msg_file_no_upload"));
179  return false;
180  }
181  else foreach( $F['error'] as $index => $error )
182  {
183  // error handling
184  if ($error > 0)
185  {
186  switch ($error)
187  {
188  case UPLOAD_ERR_INI_SIZE:
189  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
190  return false;
191  break;
192 
193  case UPLOAD_ERR_FORM_SIZE:
194  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
195  return false;
196  break;
197 
198  case UPLOAD_ERR_PARTIAL:
199  $this->setAlert($lng->txt("form_msg_file_partially_uploaded"));
200  return false;
201  break;
202 
203  case UPLOAD_ERR_NO_FILE:
204  if( !$this->getRequired() )
205  {
206  break;
207  }
208  elseif( strlen($F[self::FILE_DATA_INDEX_DODGING_FILE][$index]) )
209  {
210  break;
211  }
212  $this->setAlert($lng->txt("form_msg_file_no_upload"));
213  return false;
214  break;
215 
216  case UPLOAD_ERR_NO_TMP_DIR:
217  $this->setAlert($lng->txt("form_msg_file_missing_tmp_dir"));
218  return false;
219  break;
220 
221  case UPLOAD_ERR_CANT_WRITE:
222  $this->setAlert($lng->txt("form_msg_file_cannot_write_to_disk"));
223  return false;
224  break;
225 
226  case UPLOAD_ERR_EXTENSION:
227  $this->setAlert($lng->txt("form_msg_file_upload_stopped_ext"));
228  return false;
229  break;
230  }
231  }
232  }
233 
234  if (is_array($F['tmp_name']))
235  {
236  foreach ($F['tmp_name'] as $index => $tmpname)
237  {
238  $filename = $F['name'][$index];
239  $filename_arr = pathinfo($filename);
240  $suffix = $filename_arr["extension"];
241  $mimetype = $F['type'][$index];
242  $size_bytes = $F['size'][$index];
243  // check suffixes
244  if (strlen($tmpname) && is_array($this->getSuffixes()))
245  {
246  if (!in_array(strtolower($suffix), $this->getSuffixes()))
247  {
248  $this->setAlert($lng->txt("form_msg_file_wrong_file_type"));
249  return false;
250  }
251  }
252  }
253  }
254 
255  foreach ($F['tmp_name'] as $index => $tmpname)
256  {
257  $filename = $F['name'][$index];
258  $filename_arr = pathinfo($filename);
259  $suffix = $filename_arr["extension"];
260  $mimetype = $F['type'][$index];
261  $size_bytes = $F['size'][$index];
262  // virus handling
263  if (strlen($tmpname))
264  {
265  $vir = ilUtil::virusHandling($tmpname, $filename);
266  if ($vir[0] == false)
267  {
268  $this->setAlert($lng->txt("form_msg_file_virus_found")."<br />".$vir[1]);
269  return false;
270  }
271  }
272  }
273 
274  return $this->checkSubItemsInput();
275  }
$error
Definition: Error.php:17
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
getPostVar()
Get Post Variable.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
setAlert($a_alert)
Set Alert Text.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ render()

ilMultipleImagesInputGUI::render (   $a_mode = "")
Parameters
string$mode
Returns
string

Definition at line 281 of file class.ilMultipleImagesInputGUI.php.

References $GLOBALS, $lng, ilTextInputGUI\$suffix, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilIdentifiedMultiValuesInputGUI\buildMultiValueSubmitVar(), ilGlyphGUI\DOWN, fetchContentImageSourceFromValue(), fetchContentImageTitleFromValue(), ilGlyphGUI\get(), ilFormPropertyGUI\getDisabled(), ilUtil\getFileSizeInfo(), ilIdentifiedMultiValuesInputGUI\getIdentifiedMultiValues(), getImageRemovalCommand(), getImageUploadCommand(), ilIdentifiedMultiValuesInputGUI\getMultiValuePosIndexedSubFieldId(), ilIdentifiedMultiValuesInputGUI\getMultiValuePostVarSubFieldPosIndexed(), ilFormPropertyGUI\getPostVar(), getSuffixes(), getTemplate(), isEditElementOccuranceEnabled(), isEditElementOrderEnabled(), ilUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, ilGlyphGUI\UP, and valueHasContentImageSource().

282  {
283  global $lng;
284 
285  $tpl = $this->getTemplate();
286  $i = 0;
287  foreach ($this->getIdentifiedMultiValues() as $identifier => $value)
288  {
289  if( $this->valueHasContentImageSource($value) )
290  {
291  $tpl->setCurrentBlock('image');
292 
293  $tpl->setVariable('STORED_IMAGE_SRC', $this->fetchContentImageSourceFromValue($value));
294  $tpl->setVariable('STORED_IMAGE_ALT', ilUtil::prepareFormOutput($this->fetchContentImageTitleFromValue($value)));
295  $tpl->setVariable('STORED_IMAGE_FILENAME', $this->fetchContentImageTitleFromValue($value));
296  $tpl->setVariable("STORED_IMAGE_POST_VAR", $this->getMultiValuePostVarSubFieldPosIndexed($identifier, self::STORED_IMAGE_SUBFIELD_NAME, $i));
297 
298  $tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
299  $tpl->setVariable("IMAGE_CMD_REMOVE", $this->buildMultiValueSubmitVar($identifier, $i, $this->getImageRemovalCommand()));
300 
301  $tpl->parseCurrentBlock();
302  }
303 
304  $tpl->setCurrentBlock('addimage');
305 
306  $tpl->setVariable("IMAGE_BROWSE", $lng->txt('select_file'));
307  $tpl->setVariable("IMAGE_ID", $this->getMultiValuePosIndexedSubFieldId($identifier, self::IMAGE_UPLOAD_SUBFIELD_NAME, $i));
308  $tpl->setVariable("TXT_IMAGE_SUBMIT", $lng->txt("upload"));
309  $tpl->setVariable("IMAGE_CMD_UPLOAD", $this->buildMultiValueSubmitVar($identifier, $i, $this->getImageUploadCommand()));
310  $tpl->setVariable("UPLOAD_IMAGE_POST_VAR", $this->getMultiValuePostVarSubFieldPosIndexed($identifier, self::IMAGE_UPLOAD_SUBFIELD_NAME, $i));
311  $tpl->setVariable("COUNT_POST_VAR", $this->getMultiValuePostVarSubFieldPosIndexed($identifier, self::ITERATOR_SUBFIELD_NAME, $i));
312 
313  $tpl->parseCurrentBlock();
314 
315  if( $this->isEditElementOrderEnabled() )
316  {
317  $tpl->setCurrentBlock("move");
318  $tpl->setVariable("ID_UP", $this->getMultiValuePosIndexedSubFieldId($identifier, 'up', $i));
319  $tpl->setVariable("ID_DOWN", $this->getMultiValuePosIndexedSubFieldId($identifier, 'down', $i));
320  $tpl->setVariable("CMD_UP", $this->buildMultiValueSubmitVar($identifier, $i, 'up'));
321  $tpl->setVariable("CMD_DOWN", $this->buildMultiValueSubmitVar($identifier, $i, 'down'));
322  $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
323  $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
324  $tpl->parseCurrentBlock();
325  }
326 
327  if( $this->isEditElementOccuranceEnabled() )
328  {
329  $tpl->setCurrentBlock("row");
330  $tpl->setVariable("ID_ADD", $this->getMultiValuePosIndexedSubFieldId($identifier, 'add', $i));
331  $tpl->setVariable("ID_REMOVE", $this->getMultiValuePosIndexedSubFieldId($identifier, 'remove', $i));
332  $tpl->setVariable("CMD_ADD", $this->buildMultiValueSubmitVar($identifier, $i, 'add'));
333  $tpl->setVariable("CMD_REMOVE", $this->buildMultiValueSubmitVar($identifier, $i, 'remove'));
334  $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
335  $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
336  $tpl->parseCurrentBlock();
337  }
338 
339  $i++;
340  }
341 
342  if (is_array($this->getSuffixes()))
343  {
344  $suff_str = $delim = "";
345  foreach($this->getSuffixes() as $suffix)
346  {
347  $suff_str.= $delim.".".$suffix;
348  $delim = ", ";
349  }
350  $tpl->setCurrentBlock('allowed_image_suffixes');
351  $tpl->setVariable("TXT_ALLOWED_SUFFIXES", $lng->txt("file_allowed_suffixes")." ".$suff_str);
352  $tpl->parseCurrentBlock();
353  }
354  /*
355  $tpl->setCurrentBlock("image_heading");
356  $tpl->setVariable("ANSWER_IMAGE", $lng->txt('answer_image'));
357  $tpl->parseCurrentBlock();
358  */
359 
360  $tpl->setVariable("TXT_MAX_SIZE", ilUtil::getFileSizeInfo());
361  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
362  $tpl->setVariable("TEXT_YES", $lng->txt('yes'));
363  $tpl->setVariable("TEXT_NO", $lng->txt('no'));
364  $tpl->setVariable("DELETE_IMAGE_HEADER", $lng->txt('delete_image_header'));
365  $tpl->setVariable("DELETE_IMAGE_QUESTION", $lng->txt('delete_image_question'));
366  $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text'));
367  $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
368 
369  if (!$this->getDisabled())
370  {
371  $tpl->setCurrentBlock('js_engine_initialisation');
372  $tpl->setVariable('UPLOAD_CMD', $this->getImageUploadCommand());
373  $tpl->setVariable('REMOVE_CMD', $this->getImageRemovalCommand());
374  $tpl->setVariable('ITERATOR', self::ITERATOR_SUBFIELD_NAME);
375  $tpl->setVariable('STORED_IMAGE_POSTVAR', self::STORED_IMAGE_SUBFIELD_NAME);
376  $tpl->setVariable('UPLOAD_IMAGE_POSTVAR', self::IMAGE_UPLOAD_SUBFIELD_NAME);
377  $tpl->parseCurrentBlock();
378 
379  $globalTpl = $GLOBALS['DIC'] ? $GLOBALS['DIC']['tpl'] : $GLOBALS['tpl'];
380  $globalTpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
381  $globalTpl->addJavascript("./Services/Form/js/ServiceFormIdentifiedWizardInputExtend.js");
382  //$globalTpl->addJavascript("./Services/Form/js/ServiceFormIdentifiedImageWizardInputConcrete.js");
383  }
384 
385  return $tpl->get();
386  }
getMultiValuePostVarSubFieldPosIndexed($identifier, $subFieldIndex, $positionIndex)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getMultiValuePosIndexedSubFieldId($identifier, $subFieldIndex, $positionIndex)
getPostVar()
Get Post Variable.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static get($a_glyph, $a_text="")
Get glyph html.
static getFileSizeInfo()
global $tpl
Definition: ilias.php:8
buildMultiValueSubmitVar($identifier, $positionIndex, $submitCommand)
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ setEditElementOccuranceEnabled()

ilMultipleImagesInputGUI::setEditElementOccuranceEnabled (   $editElementOccuranceEnabled)
Parameters
boolean$editElementOccuranceEnabled

Definition at line 139 of file class.ilMultipleImagesInputGUI.php.

References $editElementOccuranceEnabled.

140  {
141  $this->editElementOccuranceEnabled = $editElementOccuranceEnabled;
142  }

◆ setEditElementOrderEnabled()

ilMultipleImagesInputGUI::setEditElementOrderEnabled (   $editElementOrderEnabled)
Parameters
boolean$editElementOrderEnabled

Definition at line 155 of file class.ilMultipleImagesInputGUI.php.

References $editElementOrderEnabled, and isValidFilenameInput().

156  {
157  $this->editElementOrderEnabled = $editElementOrderEnabled;
158  }
+ Here is the call graph for this function:

◆ setImageRemovalCommand()

ilMultipleImagesInputGUI::setImageRemovalCommand (   $imageRemovalCommand)
Parameters
string$imageRemovalCommand

Definition at line 107 of file class.ilMultipleImagesInputGUI.php.

References $imageRemovalCommand.

108  {
109  $this->imageRemovalCommand = $imageRemovalCommand;
110  }

◆ setImageUploadCommand()

ilMultipleImagesInputGUI::setImageUploadCommand (   $imageUploadCommand)
Parameters
string$imageUploadCommand

Definition at line 123 of file class.ilMultipleImagesInputGUI.php.

References $imageUploadCommand.

124  {
125  $this->imageUploadCommand = $imageUploadCommand;
126  }

◆ setSuffixes()

ilMultipleImagesInputGUI::setSuffixes (   $a_suffixes)

Set Accepted Suffixes.

Parameters
array$a_suffixesAccepted Suffixes

Definition at line 81 of file class.ilMultipleImagesInputGUI.php.

Referenced by __construct().

82  {
83  $this->suffixes = $a_suffixes;
84  }
+ Here is the caller graph for this function:

◆ valueHasContentImageSource()

ilMultipleImagesInputGUI::valueHasContentImageSource (   $value)
protected
Parameters
$value
Returns
bool

Definition at line 392 of file class.ilMultipleImagesInputGUI.php.

References ilTextInputGUI\$value.

Referenced by fetchContentImageSourceFromValue(), and render().

393  {
394  return isset($value['src']) && strlen($value['src']);
395  }
+ Here is the caller graph for this function:

◆ valueHasContentImageTitle()

ilMultipleImagesInputGUI::valueHasContentImageTitle (   $value)
protected
Parameters
$value
Returns
bool

Definition at line 415 of file class.ilMultipleImagesInputGUI.php.

References ilTextInputGUI\$value.

Referenced by fetchContentImageTitleFromValue().

416  {
417  return isset($value['title']) && strlen($value['title']);
418  }
+ Here is the caller graph for this function:

Field Documentation

◆ $editElementOccuranceEnabled

ilMultipleImagesInputGUI::$editElementOccuranceEnabled = false
protected

◆ $editElementOrderEnabled

ilMultipleImagesInputGUI::$editElementOrderEnabled = false
protected

◆ $imageRemovalCommand

ilMultipleImagesInputGUI::$imageRemovalCommand = 'removeImage'
protected

◆ $imageUploadCommand

ilMultipleImagesInputGUI::$imageUploadCommand = 'uploadImage'
protected

◆ $suffixes

ilMultipleImagesInputGUI::$suffixes = array()
protected

Definition at line 35 of file class.ilMultipleImagesInputGUI.php.

Referenced by getSuffixes().

◆ FILE_DATA_INDEX_DODGING_FILE

const ilMultipleImagesInputGUI::FILE_DATA_INDEX_DODGING_FILE = 'dodging_file'

Definition at line 21 of file class.ilMultipleImagesInputGUI.php.

◆ IMAGE_UPLOAD_SUBFIELD_NAME

const ilMultipleImagesInputGUI::IMAGE_UPLOAD_SUBFIELD_NAME = 'imageupload'

◆ ITERATOR_SUBFIELD_NAME

◆ RENDERING_TEMPLATE

const ilMultipleImagesInputGUI::RENDERING_TEMPLATE = 'tpl.prop_multi_image_inp.html'

Definition at line 15 of file class.ilMultipleImagesInputGUI.php.

◆ STORED_IMAGE_SUBFIELD_NAME

const ilMultipleImagesInputGUI::STORED_IMAGE_SUBFIELD_NAME = 'storedimage'

The documentation for this class was generated from the following file: