ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclPropertyFormGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilDclPropertyFormGUI:
+ Collaboration diagram for ilDclPropertyFormGUI:

Public Member Functions

 keepTempFileUpload (string $a_hash, string $a_field, string $a_tmp_name, string $a_name, string $a_type, ?string $a_index=null, ?string $a_sub_index=null)
 Expose method for save confirmation. More...
 
 cleanupTempFiles (string $hash)
 Cleanup temp-files. More...
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 
 executeCommand ()
 
 setTableWidth (string $a_width)
 
 getTableWidth ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setTitleIcon (string $a_titleicon)
 
 getTitleIcon ()
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setShowTopButtons (bool $a_val)
 
 getShowTopButtons ()
 
 setForceTopButtons (bool $a_val)
 
 getForceTopButtons ()
 
 addItem ($a_item)
 
 removeItemByPostVar (string $a_post_var, bool $a_remove_unused_headers=false)
 
 getItemByPostVar (string $a_post_var)
 
 setItems (array $a_items)
 
 getItems ()
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage (bool $a_val)
 
 getDisableStandardMessage ()
 
 getHideLabels ()
 
 setHideLabels (bool $a_value=true)
 
 setValuesByArray (array $a_values, bool $a_restrict_to_value_keys=false)
 
 setValuesByPost ()
 
 checkInput ()
 
 getInput (string $a_post_var, bool $ensureValidation=true)
 Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-POST variable, identified by the passed postvar. More...
 
 addCommandButton (string $a_cmd, string $a_text, string $a_id="")
 
 getCommandButtons ()
 
 clearCommandButtons ()
 
 getContent ()
 
 insertItem ( $item, bool $a_sub_item=false)
 
 addAsyncOnloadCode (string $code)
 
 getHTML ()
 
 getHTMLAsync ()
 
 getFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 
 moveFileUpload (string $a_target_directory, string $a_field, ?string $a_target_name=null, ?string $a_index=null, ?string $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

Static Public Member Functions

static getTempFilename (string $a_hash, string $a_field, string $a_name, string $a_type, ?string $a_index=null, ?string $a_sub_index=null)
 
static rebuildTempFileByHash (string $hash)
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 
- Protected Attributes inherited from ilPropertyFormGUI
bool $required_text = false
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTemplate $tpl
 
ilObjUser $user = null
 
ilSetting $settings = null
 
string $mode = "std"
 
bool $check_input_called = false
 
bool $disable_standard_message = false
 
string $top_anchor = "il_form_top"
 
string $title = ''
 
string $titleicon = ""
 
string $description = ""
 
string $tbl_width = ""
 
bool $show_top_buttons = true
 
bool $hide_labels = false
 
bool $force_top_buttons = false
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
ilGlobalTemplateInterface $global_tpl = null
 
 $onload_code = []
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $prevent_double_submission = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning ilDclPropertyFormGUI: ilFormPropertyDispatchGUI

Definition at line 22 of file class.ilDclPropertyFormGUI.php.

Member Function Documentation

◆ cleanupTempFiles()

ilDclPropertyFormGUI::cleanupTempFiles ( string  $hash)

Cleanup temp-files.

Definition at line 122 of file class.ilDclPropertyFormGUI.php.

References ilFileUtils\getDataDir().

122  : void
123  {
124  $files = glob(ilFileUtils::getDataDir() . "/temp/" . session_id() . "~~" . $hash . "~~*");
125 
126  foreach ($files as $file) {
127  if (file_exists($file)) {
128  unlink($file);
129  }
130  }
131  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ getTempFilename()

static ilDclPropertyFormGUI::getTempFilename ( string  $a_hash,
string  $a_field,
string  $a_name,
string  $a_type,
?string  $a_index = null,
?string  $a_sub_index = null 
)
static

Definition at line 39 of file class.ilDclPropertyFormGUI.php.

References ilFileUtils\getDataDir().

Referenced by ilDclFileuploadRecordFieldModel\parseValue(), and ilDclMobRecordFieldModel\parseValue().

46  : string {
47  $a_name = ilFileUtils::getAsciiFileName($a_name);
48 
49  $tmp_file_name = implode(
50  "~~",
51  array(
52  session_id(),
53  $a_hash,
54  $a_field,
55  $a_index,
56  $a_sub_index,
57  str_replace("/", "~~", $a_type),
58  str_replace("~~", "_", $a_name),
59  )
60  );
61 
62  // make sure temp directory exists
63  $temp_path = ilFileUtils::getDataDir() . "/temp/";
64 
65  return $temp_path . $tmp_file_name;
66  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ keepTempFileUpload()

ilDclPropertyFormGUI::keepTempFileUpload ( string  $a_hash,
string  $a_field,
string  $a_tmp_name,
string  $a_name,
string  $a_type,
?string  $a_index = null,
?string  $a_sub_index = null 
)

Expose method for save confirmation.

Definition at line 27 of file class.ilDclPropertyFormGUI.php.

35  : void {
36  $this->keepFileUpload($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index, $a_sub_index);
37  }

◆ rebuildTempFileByHash()

static ilDclPropertyFormGUI::rebuildTempFileByHash ( string  $hash)
static
Exceptions
ilDclException

Definition at line 71 of file class.ilDclPropertyFormGUI.php.

References ilFormGUI\$name, $type, and ilFileUtils\getDataDir().

Referenced by ilDclRecordEditGUI\save(), and ilDclRecordListGUI\sendFile().

71  : void
72  {
73  $temp_path = ilFileUtils::getDataDir() . "/temp";
74  if (is_dir($temp_path)) {
75  $temp_files = glob($temp_path . "/" . session_id() . "~~" . $hash . "~~*");
76  if (is_array($temp_files)) {
77  foreach ($temp_files as $full_file) {
78  $file = explode("~~", basename($full_file));
79  $field = $file[2];
80  $idx = $file[3];
81  $idx2 = $file[4];
82  $type = $file[5] . "/" . $file[6];
83  $name = $file[7];
84 
85  if ($idx2 != "") {
86  if (!($_FILES[$field]["tmp_name"][$idx][$idx2] ?? false)) {
87  $_FILES[$field]["tmp_name"][$idx][$idx2] = $full_file;
88  $_FILES[$field]["name"][$idx][$idx2] = $name;
89  $_FILES[$field]["type"][$idx][$idx2] = $type;
90  $_FILES[$field]["error"][$idx][$idx2] = 0;
91  $_FILES[$field]["size"][$idx][$idx2] = filesize($full_file);
92  }
93  } else {
94  if ($idx != "") {
95  if (!($_FILES[$field]["tmp_name"][$idx] ?? false)) {
96  $_FILES[$field]["tmp_name"][$idx] = $full_file;
97  $_FILES[$field]["name"][$idx] = $name;
98  $_FILES[$field]["type"][$idx] = $type;
99  $_FILES[$field]["error"][$idx] = 0;
100  $_FILES[$field]["size"][$idx] = filesize($full_file);
101  }
102  } else {
103  if (!($_FILES[$field]["tmp_name"] ?? false)) {
104  $_FILES[$field]["tmp_name"] = $full_file;
105  $_FILES[$field]["name"] = $name;
106  $_FILES[$field]["type"] = $type;
107  $_FILES[$field]["error"] = 0;
108  $_FILES[$field]["size"] = filesize($full_file);
109  }
110  }
111  }
112  }
113  }
114  } else {
115  throw new ilDclException('temp dir path "' . $temp_path . '" is not a directory');
116  }
117  }
$type
static getDataDir()
get data directory (outside webspace)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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