ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclPropertyFormGUI Class Reference

Class ilDclPropertyFormGUI ilDclPropertyFormGUI: ilFormPropertyDispatchGUI. 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 ()
 
 checkForRequiredField ()
 
- 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

Member Function Documentation

◆ cleanupTempFiles()

ilDclPropertyFormGUI::cleanupTempFiles ( string  $hash)

Cleanup temp-files.

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

References ilFileUtils\getDataDir().

125  : void
126  {
127  $files = glob(ilFileUtils::getDataDir() . "/temp/" . session_id() . "~~" . $hash . "~~*");
128 
129  foreach ($files as $file) {
130  if (file_exists($file)) {
131  unlink($file);
132  }
133  }
134  }
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 42 of file class.ilDclPropertyFormGUI.php.

References ilFileUtils\getASCIIFilename(), and ilFileUtils\getDataDir().

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

49  : string {
50  $a_name = ilFileUtils::getASCIIFilename($a_name);
51 
52  $tmp_file_name = implode(
53  "~~",
54  [
55  session_id(),
56  $a_hash,
57  $a_field,
58  $a_index,
59  $a_sub_index,
60  str_replace("/", "~~", $a_type),
61  str_replace("~~", "_", $a_name),
62  ]
63  );
64 
65  // make sure temp directory exists
66  $temp_path = ilFileUtils::getDataDir() . "/temp/";
67 
68  return $temp_path . $tmp_file_name;
69  }
static getASCIIFilename(string $a_filename)
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 30 of file class.ilDclPropertyFormGUI.php.

38  : void {
39  $this->keepFileUpload($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index, $a_sub_index);
40  }

◆ rebuildTempFileByHash()

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

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

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

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

74  : void
75  {
76  $temp_path = ilFileUtils::getDataDir() . "/temp";
77  if (is_dir($temp_path)) {
78  $temp_files = glob($temp_path . "/" . session_id() . "~~" . $hash . "~~*");
79  if (is_array($temp_files)) {
80  foreach ($temp_files as $full_file) {
81  $file = explode("~~", basename($full_file));
82  $field = $file[2];
83  $idx = $file[3];
84  $idx2 = $file[4];
85  $type = $file[5] . "/" . $file[6];
86  $name = $file[7];
87 
88  if ($idx2 != "") {
89  if (!($_FILES[$field]["tmp_name"][$idx][$idx2] ?? false)) {
90  $_FILES[$field]["tmp_name"][$idx][$idx2] = $full_file;
91  $_FILES[$field]["name"][$idx][$idx2] = $name;
92  $_FILES[$field]["type"][$idx][$idx2] = $type;
93  $_FILES[$field]["error"][$idx][$idx2] = 0;
94  $_FILES[$field]["size"][$idx][$idx2] = filesize($full_file);
95  }
96  } else {
97  if ($idx != "") {
98  if (!($_FILES[$field]["tmp_name"][$idx] ?? false)) {
99  $_FILES[$field]["tmp_name"][$idx] = $full_file;
100  $_FILES[$field]["name"][$idx] = $name;
101  $_FILES[$field]["type"][$idx] = $type;
102  $_FILES[$field]["error"][$idx] = 0;
103  $_FILES[$field]["size"][$idx] = filesize($full_file);
104  }
105  } else {
106  if (!($_FILES[$field]["tmp_name"] ?? false)) {
107  $_FILES[$field]["tmp_name"] = $full_file;
108  $_FILES[$field]["name"] = $name;
109  $_FILES[$field]["type"] = $type;
110  $_FILES[$field]["error"] = 0;
111  $_FILES[$field]["size"] = filesize($full_file);
112  }
113  }
114  }
115  }
116  }
117  } else {
118  throw new ilDclException('temp dir path "' . $temp_path . '" is not a directory');
119  }
120  }
static getDataDir()
get data directory (outside webspace)
+ 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: