ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDclPropertyFormGUI Class Reference

Class ilDclPropertyFormGUI. More...

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

Public Member Functions

 keepTempFileUpload ($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index=null, $a_sub_index=null)
 Expose method for save confirmation. More...
 
 cleanupTempFiles ($hash)
 Cleanup temp-files. More...
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTableWidth ($a_width)
 Set table width. More...
 
 getTableWidth ()
 get table width More...
 
 setMode ($a_mode)
 Set Mode ('std', 'subform'). More...
 
 getMode ()
 Get Mode ('std', 'subform'). More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setTitleIcon ($a_titleicon)
 Set TitleIcon. More...
 
 getTitleIcon ()
 Get TitleIcon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setShowTopButtons ($a_val)
 Get show top buttons. More...
 
 getShowTopButtons ()
 Set show top buttons. More...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var, $a_remove_unused_headers=false)
 Remove Item. More...
 
 getItemByPostVar ($a_post_var)
 Get Item by POST variable. More...
 
 setItems ($a_items)
 Set Items. More...
 
 getItems ()
 Get Items. More...
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage ($a_val)
 Set disable standard message. More...
 
 getDisableStandardMessage ()
 Get disable standard message. More...
 
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not. More...
 
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not. More...
 
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array. More...
 
 setValuesByPost ()
 Set form values from POST values. More...
 
 checkInput ()
 Check Post Input. More...
 
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id. More...
 
 addCustomProperty ( $a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property. More...
 
 addCommandButton ($a_cmd, $a_text, $a_id="")
 Add Command button. More...
 
 getCommandButtons ()
 Return all Command buttons. More...
 
 clearCommandButtons ()
 Remove all command buttons. More...
 
 getContent ()
 Get Content. More...
 
 insertItem ($item, $a_sub_item=false)
 
 getHTML ()
 
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded? More...
 
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Static Public Member Functions

static getTempFilename ($a_hash, $a_field, $a_name, $a_type, $a_index=null, $a_sub_index=null)
 return temp-filename More...
 
static rebuildTempFileByHash ($hash)
 Return temp files. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 
- Protected Attributes inherited from ilPropertyFormGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $mode = "std"
 
 $check_input_called = false
 
 $disable_standard_message = false
 
 $top_anchor = "il_form_top"
 
 $titleicon = false
 
 $description = ""
 
 $tbl_width = false
 
 $show_top_buttons = true
 
 $hide_labels = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Detailed Description

Member Function Documentation

◆ cleanupTempFiles()

ilDclPropertyFormGUI::cleanupTempFiles (   $hash)

Cleanup temp-files.

Parameters
$hash

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

References $file, $files, and ilUtil\getDataDir().

121  {
122  $files = glob(ilUtil::getDataDir() . "/temp/" . session_id() . "~~" . $hash . "~~*");
123 
124  foreach ($files as $file) {
125  if (file_exists($file)) {
126  unlink($file);
127  }
128  }
129  }
$files
Definition: add-vimline.php:18
static getDataDir()
get data directory (outside webspace)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ getTempFilename()

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

return temp-filename

Parameters
$a_hash
$a_field
$a_name
$a_type
null$a_index
null$a_sub_index
Returns
string

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

References $a_type, array, and ilUtil\getDataDir().

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

41  {
42  $a_name = ilUtil::getAsciiFileName($a_name);
43 
44  $tmp_file_name = implode(
45  "~~",
46  array(session_id(),
47  $a_hash,
48  $a_field,
49  $a_index,
50  $a_sub_index,
51  str_replace("/", "~~", $a_type),
52  str_replace("~~", "_", $a_name))
53  );
54 
55  // make sure temp directory exists
56  $temp_path = ilUtil::getDataDir() . "/temp/";
57  return $temp_path . $tmp_file_name;
58  }
$a_type
Definition: workflow.php:92
Create styles array
The data for the language used.
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 (   $a_hash,
  $a_field,
  $a_tmp_name,
  $a_name,
  $a_type,
  $a_index = null,
  $a_sub_index = null 
)

Expose method for save confirmation.

Parameters
$a_hash
$a_field
$a_tmp_name
$a_name
$a_type
null$a_index
null$a_sub_index

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

References $a_type.

25  {
26  $this->keepFileUpload($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index, $a_sub_index);
27  }
$a_type
Definition: workflow.php:92

◆ rebuildTempFileByHash()

static ilDclPropertyFormGUI::rebuildTempFileByHash (   $hash)
static

Return temp files.

Parameters
$hash
Exceptions
ilDclException

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

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

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

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