ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilFileVersionFormGUI Class Reference

Class ilFileVersionFormGUI. More...

+ Inheritance diagram for ilFileVersionFormGUI:
+ Collaboration diagram for ilFileVersionFormGUI:

Public Member Functions

 __construct (ilFileVersionsGUI $file_version_gui, $mode=self::MODE_ADD)
 ilFileVersionFormGUI constructor. More...
 
 fillForm ()
 
- 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...
 

Data Fields

const MODE_ADD = 1
 
const MODE_REPLACE = 2
 
const F_TITLE = 'title'
 
const F_DESCRIPTION = "description"
 
const F_FILE = "file"
 
const F_SAVE_MODE = 'save_mode'
 

Protected Attributes

 $dnd = true
 
- 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
 

Private Member Functions

 initForm ()
 

Private Attributes

 $save_mode = self::MODE_ADD
 
 $upload
 
 $file
 
 $calling_gui
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilFileVersionFormGUI::__construct ( ilFileVersionsGUI  $file_version_gui,
  $mode = self::MODE_ADD 
)

ilFileVersionFormGUI constructor.

Parameters
ilFileVersionsGUI$file_version_gui

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

References $DIC, ilPropertyFormGUI\$mode, ilFileVersionsGUI\getFile(), initForm(), ilFormGUI\setFormAction(), and ilFormGUI\setTarget().

48  {
49  global $DIC;
50  $this->file = $file_version_gui->getFile();
51  $this->upload = $DIC->upload();
52  $this->calling_gui = $file_version_gui;
53  $this->lng = $DIC->language();
54  $this->save_mode = $mode;
55  parent::__construct();
56  $this->initForm();
57  $this->setTarget('_top');
58  $this->setFormAction($DIC->ctrl()->getFormAction($file_version_gui));
59  }
global $DIC
Definition: saml.php:7
setFormAction($a_formaction)
Set FormAction.
setTarget($a_target)
Set Target.
+ Here is the call graph for this function:

Member Function Documentation

◆ fillForm()

ilFileVersionFormGUI::fillForm ( )

Definition at line 176 of file class.ilFileVersionFormGUI.php.

References $values, and ilPropertyFormGUI\setValuesByArray().

177  {
178  $values = [];
179  $values[self::F_TITLE] = $this->file->getTitle();
180  $values[self::F_DESCRIPTION] = $this->file->getDescription();
181 
182  $this->setValuesByArray($values);
183  }
$values
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
+ Here is the call graph for this function:

◆ initForm()

ilFileVersionFormGUI::initForm ( )
private

Definition at line 62 of file class.ilFileVersionFormGUI.php.

References ilPropertyFormGUI\$description, $DIC, $file, $result, $title, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPropertyFormGUI\checkInput(), ilFileVersionsGUI\CMD_CREATE_NEW_VERSION, ilFileVersionsGUI\CMD_CREATE_REPLACING_VERSION, ilFileVersionsGUI\CMD_DEFAULT, ilPropertyFormGUI\getInput(), ilUtil\sendInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilPropertyFormGUI\setTitle(), ilUtil\stripSlashes(), and ilObject\TITLE_LENGTH.

Referenced by __construct().

63  {
64  // Buttons and Title
65  $this->lng->loadLanguageModule('file');
66  switch ($this->save_mode) {
67  case self::MODE_REPLACE:
68  ilUtil::sendInfo($this->lng->txt('replace_file_info'));
69  $this->setTitle($this->lng->txt('replace_file'));
70  $this->addCommandButton(ilFileVersionsGUI::CMD_CREATE_REPLACING_VERSION, $this->lng->txt('replace_file'));
71  break;
72  case self::MODE_ADD:
73  ilUtil::sendInfo($this->lng->txt('file_new_version_info'));
74  $this->setTitle($this->lng->txt('file_new_version'));
75  $this->addCommandButton(ilFileVersionsGUI::CMD_CREATE_NEW_VERSION, $this->lng->txt('file_new_version'));
76  break;
77  }
78  $this->addCommandButton(ilFileVersionsGUI::CMD_DEFAULT, $this->lng->txt('cancel'));
79 
80  // Title
81  $title = new ilTextInputGUI($this->lng->txt(self::F_TITLE), self::F_TITLE);
82  $title->setInfo($this->lng->txt("if_no_title_then_filename"));
83  $title->setSize(min(40, ilObject::TITLE_LENGTH));
84 
85  $title->setMaxLength(ilObject::TITLE_LENGTH);
86 
87  $this->addItem($title);
88 
89  // File Description
90  $description = new ilTextAreaInputGUI($this->lng->txt(self::F_DESCRIPTION), self::F_DESCRIPTION);
91  $this->addItem($description);
92 
93  // File
94  if ($this->dnd) {
95  // File (D&D)
98  $this->lng->txt(self::F_FILE),
99  self::F_FILE
100  );
101  $file->setRequired(true);
102  // $file->setUploadUrl($this->ctrl->getLinkTarget($this->calling_gui, ilFileVersionsGUI::C, "", true, true));
103  $file->setMaxFiles(1);
104  $this->addItem($file);
105  } else {
106  // File (classical)
107  $in_file = new ilFileInputGUI($this->lng->txt(self::F_FILE), self::F_FILE);
108  $in_file->setRequired(true);
109  $this->addItem($in_file);
110  }
111  }
const TITLE_LENGTH
max length of object title
This class represents a file property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Information Text.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setTitle($a_title)
Set Title.
This class represents a text property in a property form.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
This class represents a text area property in a property form.
Class ilFileStandardDropzoneInputGUI.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $calling_gui

ilFileVersionFormGUI::$calling_gui
private

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

◆ $dnd

ilFileVersionFormGUI::$dnd = true
protected

Definition at line 23 of file class.ilFileVersionFormGUI.php.

◆ $file

ilFileVersionFormGUI::$file
private

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

Referenced by initForm().

◆ $save_mode

ilFileVersionFormGUI::$save_mode = self::MODE_ADD
private

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

◆ $upload

ilFileVersionFormGUI::$upload
private

Definition at line 31 of file class.ilFileVersionFormGUI.php.

◆ F_DESCRIPTION

const ilFileVersionFormGUI::F_DESCRIPTION = "description"

Definition at line 17 of file class.ilFileVersionFormGUI.php.

◆ F_FILE

const ilFileVersionFormGUI::F_FILE = "file"

Definition at line 18 of file class.ilFileVersionFormGUI.php.

◆ F_SAVE_MODE

const ilFileVersionFormGUI::F_SAVE_MODE = 'save_mode'

Definition at line 19 of file class.ilFileVersionFormGUI.php.

◆ F_TITLE

const ilFileVersionFormGUI::F_TITLE = 'title'

Definition at line 16 of file class.ilFileVersionFormGUI.php.

◆ MODE_ADD

const ilFileVersionFormGUI::MODE_ADD = 1

Definition at line 14 of file class.ilFileVersionFormGUI.php.

Referenced by ilFileVersionsGUI\executeCommand().

◆ MODE_REPLACE

const ilFileVersionFormGUI::MODE_REPLACE = 2

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

Referenced by ilFileVersionsGUI\executeCommand().


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