ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 ilTermsOfServiceDocumentFormGUI constructor. More...
 
 setCheckInputCalled (bool $status)
 
 hasTranslatedError ()
 
 getTranslatedError ()
 
 hasTranslatedInfo ()
 
 getTranslatedInfo ()
 
 saveObject ()
 
- 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...
 

Protected Member Functions

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

Protected Attributes

 $document
 
 $actor
 
 $fileUpload
 
 $tmpFileSystem
 
 $formAction
 
 $saveCommand
 
 $cancelCommand
 
 $isEditable = false
 
 $translatedError = ''
 
 $translatedInfo = ''
 
 $documentPurifier
 
- 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

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 
)

ilTermsOfServiceDocumentFormGUI constructor.

Parameters
\ilTermsOfServiceDocument$document
\ilHtmlPurifierInterface$documentPurifier
\ilObjUser$actor
Filesystem$tmpFileSystem
FileUpload$fileUpload
string$formAction
string$saveCommand
string$cancelCommand
bool$isEditable

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

References $actor, $cancelCommand, $document, $documentPurifier, $fileUpload, $formAction, $isEditable, $saveCommand, $tmpFileSystem, and initForm().

71  {
72  $this->document = $document;
73  $this->documentPurifier = $documentPurifier;
74  $this->actor = $actor;
75  $this->tmpFileSystem = $tmpFileSystem;
76  $this->fileUpload = $fileUpload;
77  $this->formAction = $formAction;
78  $this->saveCommand = $saveCommand;
79  $this->cancelCommand = $cancelCommand;
80  $this->isEditable = $isEditable;
81 
82  parent::__construct();
83 
84  $this->initForm();
85  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getTranslatedError()

ilTermsOfServiceDocumentFormGUI::getTranslatedError ( )
Returns
string

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

References $translatedError.

◆ getTranslatedInfo()

ilTermsOfServiceDocumentFormGUI::getTranslatedInfo ( )
Returns
string

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

References $translatedInfo.

◆ hasTranslatedError()

ilTermsOfServiceDocumentFormGUI::hasTranslatedError ( )
Returns
bool

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

142  : bool
143  {
144  return strlen($this->translatedError);
145  }

◆ hasTranslatedInfo()

ilTermsOfServiceDocumentFormGUI::hasTranslatedInfo ( )
Returns
bool

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

158  : bool
159  {
160  return strlen($this->translatedInfo);
161  }

◆ initForm()

ilTermsOfServiceDocumentFormGUI::initForm ( )
protected

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

References $document, $title, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilFormGUI\setFormAction(), and ilPropertyFormGUI\setTitle().

Referenced by __construct().

99  {
100  if ($this->document->getId() > 0) {
101  $this->setTitle($this->lng->txt('tos_form_edit_doc_head'));
102  } else {
103  $this->setTitle($this->lng->txt('tos_form_new_doc_head'));
104  }
105 
106  $this->setFormAction($this->formAction);
107 
108  $title = new \ilTextInputGUI($this->lng->txt('tos_form_document_title'), 'title');
109  $title->setInfo($this->lng->txt('tos_form_document_title_info'));
110  $title->setRequired(true);
111  $title->setDisabled(!$this->isEditable);
112  $title->setValue($this->document->getTitle());
113  $title->setMaxLength(255);
114  $this->addItem($title);
115 
116  $documentLabel = $this->lng->txt('tos_form_document');
117  $documentByline = $this->lng->txt('tos_form_document_info');
118  if ($this->document->getId() > 0) {
119  $documentLabel = $this->lng->txt('tos_form_document_new');
120  $documentByline = $this->lng->txt('tos_form_document_new_info');
121  }
122 
123  $document = new ilFileInputGUI($documentLabel, 'document');
124  $document->setInfo($documentByline);
125  if (!$this->document->getId()) {
126  $document->setRequired(true);
127  }
128  $document->setDisabled(!$this->isEditable);
129  $document->setSuffixes(['html', 'txt']);
130  $this->addItem($document);
131 
132  if ($this->isEditable) {
133  $this->addCommandButton($this->saveCommand, $this->lng->txt('save'));
134  }
135 
136  $this->addCommandButton($this->cancelCommand, $this->lng->txt('cancel'));
137  }
This class represents a file property in a property form.
setFormAction($a_formaction)
Set FormAction.
addItem($a_item)
Add Item (Property, SectionHeader).
setTitle($a_title)
Set Title.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilTermsOfServiceDocumentFormGUI::saveObject ( )
Returns
bool

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

References ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ActiveRecord\orderBy(), and ilPropertyFormGUI\setValuesByPost().

174  : bool
175  {
176  if (!$this->fillObject()) {
177  $this->setValuesByPost();
178  return false;
179  }
180 
181  $this->document->save();
182 
183  return true;
184  }
setValuesByPost()
Set form values from POST values.
+ Here is the call graph for this function:

◆ setCheckInputCalled()

ilTermsOfServiceDocumentFormGUI::setCheckInputCalled ( bool  $status)
Parameters
bool$status

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

91  {
92  $this->check_input_called = $status;
93  }

Field Documentation

◆ $actor

ilTermsOfServiceDocumentFormGUI::$actor
protected

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

Referenced by __construct().

◆ $cancelCommand

ilTermsOfServiceDocumentFormGUI::$cancelCommand
protected

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

Referenced by __construct().

◆ $document

ilTermsOfServiceDocumentFormGUI::$document
protected

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

Referenced by __construct(), and initForm().

◆ $documentPurifier

ilTermsOfServiceDocumentFormGUI::$documentPurifier
protected

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

Referenced by __construct().

◆ $fileUpload

ilTermsOfServiceDocumentFormGUI::$fileUpload
protected

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

Referenced by __construct().

◆ $formAction

ilTermsOfServiceDocumentFormGUI::$formAction
protected

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

Referenced by __construct().

◆ $isEditable

ilTermsOfServiceDocumentFormGUI::$isEditable = false
protected

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

Referenced by __construct().

◆ $saveCommand

ilTermsOfServiceDocumentFormGUI::$saveCommand
protected

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

Referenced by __construct().

◆ $tmpFileSystem

ilTermsOfServiceDocumentFormGUI::$tmpFileSystem
protected

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

Referenced by __construct().

◆ $translatedError

ilTermsOfServiceDocumentFormGUI::$translatedError = ''
protected

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

Referenced by getTranslatedError().

◆ $translatedInfo

ilTermsOfServiceDocumentFormGUI::$translatedInfo = ''
protected

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

Referenced by getTranslatedInfo().


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