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

Class ilTermsOfServiceDocumentFormGUI. More...

+ Inheritance diagram for ilTermsOfServiceDocumentFormGUI:
+ Collaboration diagram for ilTermsOfServiceDocumentFormGUI:

Public Member Functions

 __construct (ilTermsOfServiceDocument $document, ilHtmlPurifierInterface $documentPurifier, ilObjUser $actor, Filesystem $tmpFileSystem, FileUpload $fileUpload, string $formAction='', string $saveCommand='saveDocument', string $cancelCommand='showDocuments', bool $isEditable=false)
 
 setCheckInputCalled (bool $status)
 
 hasTranslatedError ()
 
 getTranslatedError ()
 
 hasTranslatedInfo ()
 
 getTranslatedInfo ()
 
 saveObject ()
 
- 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 ()
 

Protected Member Functions

 initForm ()
 
- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 

Protected Attributes

ilTermsOfServiceDocument $document
 
ilObjUser $actor
 
FileUpload $fileUpload
 
Filesystem $tmpFileSystem
 
string $formAction
 
string $saveCommand
 
string $cancelCommand
 
bool $isEditable = false
 
string $translatedError = ''
 
string $translatedInfo = ''
 
ilHtmlPurifierInterface $documentPurifier
 
- 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

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceDocumentFormGUI::__construct ( ilTermsOfServiceDocument  $document,
ilHtmlPurifierInterface  $documentPurifier,
ilObjUser  $actor,
Filesystem  $tmpFileSystem,
FileUpload  $fileUpload,
string  $formAction = '',
string  $saveCommand = 'saveDocument',
string  $cancelCommand = 'showDocuments',
bool  $isEditable = false 
)

Definition at line 44 of file class.ilTermsOfServiceDocumentFormGUI.php.

References $actor, $cancelCommand, $document, $documentPurifier, $fileUpload, $formAction, $isEditable, $saveCommand, $tmpFileSystem, ILIAS\GlobalScreen\Provider\__construct(), and initForm().

54  {
55  $this->document = $document;
56  $this->documentPurifier = $documentPurifier;
57  $this->actor = $actor;
58  $this->tmpFileSystem = $tmpFileSystem;
59  $this->fileUpload = $fileUpload;
60  $this->formAction = $formAction;
61  $this->saveCommand = $saveCommand;
62  $this->cancelCommand = $cancelCommand;
63  $this->isEditable = $isEditable;
64 
66 
67  $this->initForm();
68  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getTranslatedError()

ilTermsOfServiceDocumentFormGUI::getTranslatedError ( )

Definition at line 121 of file class.ilTermsOfServiceDocumentFormGUI.php.

References $translatedError.

121  : string
122  {
123  return $this->translatedError;
124  }

◆ getTranslatedInfo()

ilTermsOfServiceDocumentFormGUI::getTranslatedInfo ( )

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

References $translatedInfo.

131  : string
132  {
133  return $this->translatedInfo;
134  }

◆ hasTranslatedError()

ilTermsOfServiceDocumentFormGUI::hasTranslatedError ( )

Definition at line 116 of file class.ilTermsOfServiceDocumentFormGUI.php.

116  : bool
117  {
118  return $this->translatedError !== '';
119  }

◆ hasTranslatedInfo()

ilTermsOfServiceDocumentFormGUI::hasTranslatedInfo ( )

Definition at line 126 of file class.ilTermsOfServiceDocumentFormGUI.php.

126  : bool
127  {
128  return $this->translatedInfo !== '';
129  }

◆ initForm()

ilTermsOfServiceDocumentFormGUI::initForm ( )
protected

Definition at line 75 of file class.ilTermsOfServiceDocumentFormGUI.php.

References ilPropertyFormGUI\$title, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), and ilPropertyFormGUI\setTitle().

Referenced by __construct().

75  : void
76  {
77  if ($this->document->getId() > 0) {
78  $this->setTitle($this->lng->txt('tos_form_edit_doc_head'));
79  } else {
80  $this->setTitle($this->lng->txt('tos_form_new_doc_head'));
81  }
82 
83  $this->setFormAction($this->formAction);
84 
85  $title = new ilTextInputGUI($this->lng->txt('tos_form_document_title'), 'title');
86  $title->setInfo($this->lng->txt('tos_form_document_title_info'));
87  $title->setRequired(true);
88  $title->setDisabled(!$this->isEditable);
89  $title->setValue($this->document->getTitle());
90  $title->setMaxLength(255);
91  $this->addItem($title);
92 
93  $documentLabel = $this->lng->txt('tos_form_document');
94  $documentByline = $this->lng->txt('tos_form_document_info');
95  if ($this->document->getId() > 0) {
96  $documentLabel = $this->lng->txt('tos_form_document_new');
97  $documentByline = $this->lng->txt('tos_form_document_new_info');
98  }
99 
100  $document = new ilFileInputGUI($documentLabel, 'document');
101  $document->setInfo($documentByline);
102  if (!$this->document->getId()) {
103  $document->setRequired(true);
104  }
105  $document->setDisabled(!$this->isEditable);
106  $document->setSuffixes(['html', 'txt']);
107  $this->addItem($document);
108 
109  if ($this->isEditable) {
110  $this->addCommandButton($this->saveCommand, $this->lng->txt('save'));
111  }
112 
113  $this->addCommandButton($this->cancelCommand, $this->lng->txt('cancel'));
114  }
This class represents a file property in a property form.
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilTermsOfServiceDocumentFormGUI::saveObject ( )

Definition at line 136 of file class.ilTermsOfServiceDocumentFormGUI.php.

References Vendor\Package\$e, ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ILIAS\Repository\lng(), ActiveRecord\orderBy(), and ilPropertyFormGUI\setValuesByPost().

136  : bool
137  {
138  if (!$this->fillObject()) {
139  $this->setValuesByPost();
140  return false;
141  }
142 
143  $this->document->save();
144 
145  return true;
146  }
+ Here is the call graph for this function:

◆ setCheckInputCalled()

ilTermsOfServiceDocumentFormGUI::setCheckInputCalled ( bool  $status)

Definition at line 70 of file class.ilTermsOfServiceDocumentFormGUI.php.

70  : void
71  {
72  $this->check_input_called = $status;
73  }

Field Documentation

◆ $actor

ilObjUser ilTermsOfServiceDocumentFormGUI::$actor
protected

Definition at line 33 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by __construct().

◆ $cancelCommand

string ilTermsOfServiceDocumentFormGUI::$cancelCommand
protected

Definition at line 38 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by __construct().

◆ $document

ilTermsOfServiceDocument ilTermsOfServiceDocumentFormGUI::$document
protected

Definition at line 32 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by __construct().

◆ $documentPurifier

ilHtmlPurifierInterface ilTermsOfServiceDocumentFormGUI::$documentPurifier
protected

Definition at line 42 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by __construct().

◆ $fileUpload

FileUpload ilTermsOfServiceDocumentFormGUI::$fileUpload
protected

Definition at line 34 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by __construct().

◆ $formAction

string ilTermsOfServiceDocumentFormGUI::$formAction
protected

Definition at line 36 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by __construct().

◆ $isEditable

bool ilTermsOfServiceDocumentFormGUI::$isEditable = false
protected

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

Referenced by __construct().

◆ $saveCommand

string ilTermsOfServiceDocumentFormGUI::$saveCommand
protected

Definition at line 37 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by __construct().

◆ $tmpFileSystem

Filesystem ilTermsOfServiceDocumentFormGUI::$tmpFileSystem
protected

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

Referenced by __construct().

◆ $translatedError

string ilTermsOfServiceDocumentFormGUI::$translatedError = ''
protected

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

Referenced by getTranslatedError().

◆ $translatedInfo

string ilTermsOfServiceDocumentFormGUI::$translatedInfo = ''
protected

Definition at line 41 of file class.ilTermsOfServiceDocumentFormGUI.php.

Referenced by getTranslatedInfo().


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