ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAccessibilityDocumentFormGUI Class Reference

Class ilAccessibilityDocumentFormGUI. More...

+ Inheritance diagram for ilAccessibilityDocumentFormGUI:
+ Collaboration diagram for ilAccessibilityDocumentFormGUI:

Public Member Functions

 __construct (ilAccessibilityDocument $document, ilHtmlPurifierInterface $documentPurifier, ilObjUser $actor, Filesystem $tmpFileSystem, FileUpload $fileUpload, string $formAction='', string $saveCommand='saveDocument', string $cancelCommand='showDocuments', bool $isEditable=false)
 ilAccessibilityDocumentFormGUI 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...
 
 setForceTopButtons ($a_val)
 Set force top buttons. More...
 
 getForceTopButtons ()
 Get force 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
 
 $force_top_buttons = 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()

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

ilAccessibilityDocumentFormGUI constructor.

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

Definition at line 60 of file class.ilAccessibilityDocumentFormGUI.php.

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

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

Member Function Documentation

◆ getTranslatedError()

ilAccessibilityDocumentFormGUI::getTranslatedError ( )
Returns
string

Definition at line 149 of file class.ilAccessibilityDocumentFormGUI.php.

References $translatedError.

149  : string
150  {
151  return $this->translatedError;
152  }

◆ getTranslatedInfo()

ilAccessibilityDocumentFormGUI::getTranslatedInfo ( )
Returns
string

Definition at line 165 of file class.ilAccessibilityDocumentFormGUI.php.

References $translatedInfo.

165  : string
166  {
167  return $this->translatedInfo;
168  }

◆ hasTranslatedError()

ilAccessibilityDocumentFormGUI::hasTranslatedError ( )
Returns
bool

Definition at line 141 of file class.ilAccessibilityDocumentFormGUI.php.

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

◆ hasTranslatedInfo()

ilAccessibilityDocumentFormGUI::hasTranslatedInfo ( )
Returns
bool

Definition at line 157 of file class.ilAccessibilityDocumentFormGUI.php.

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

◆ initForm()

ilAccessibilityDocumentFormGUI::initForm ( )
protected

Definition at line 97 of file class.ilAccessibilityDocumentFormGUI.php.

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

Referenced by __construct().

97  : void
98  {
99  if ($this->document->getId() > 0) {
100  $this->setTitle($this->lng->txt('acc_form_edit_doc_head'));
101  } else {
102  $this->setTitle($this->lng->txt('acc_form_new_doc_head'));
103  }
104 
105  $this->setFormAction($this->formAction);
106 
107  $title = new ilTextInputGUI($this->lng->txt('acc_form_document_title'), 'title');
108  $title->setInfo($this->lng->txt('acc_form_document_title_info'));
109  $title->setRequired(true);
110  $title->setDisabled(!$this->isEditable);
111  $title->setValue($this->document->getTitle());
112  $title->setMaxLength(255);
113  $this->addItem($title);
114 
115  $documentLabel = $this->lng->txt('acc_form_document');
116  $documentByline = $this->lng->txt('acc_form_document_info');
117  if ($this->document->getId() > 0) {
118  $documentLabel = $this->lng->txt('acc_form_document_new');
119  $documentByline = $this->lng->txt('acc_form_document_new_info');
120  }
121 
122  $document = new ilFileInputGUI($documentLabel, 'document');
123  $document->setInfo($documentByline);
124  if (!$this->document->getId()) {
125  $document->setRequired(true);
126  }
127  $document->setDisabled(!$this->isEditable);
128  $document->setSuffixes(['html', 'txt']);
129  $this->addItem($document);
130 
131  if ($this->isEditable) {
132  $this->addCommandButton($this->saveCommand, $this->lng->txt('save'));
133  }
134 
135  $this->addCommandButton($this->cancelCommand, $this->lng->txt('cancel'));
136  }
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()

ilAccessibilityDocumentFormGUI::saveObject ( )
Returns
bool

Definition at line 173 of file class.ilAccessibilityDocumentFormGUI.php.

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

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

◆ setCheckInputCalled()

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

Definition at line 89 of file class.ilAccessibilityDocumentFormGUI.php.

89  : void
90  {
91  $this->check_input_called = $status;
92  }

Field Documentation

◆ $actor

ilAccessibilityDocumentFormGUI::$actor
protected

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

Referenced by __construct().

◆ $cancelCommand

ilAccessibilityDocumentFormGUI::$cancelCommand
protected

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

Referenced by __construct().

◆ $document

ilAccessibilityDocumentFormGUI::$document
protected

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

Referenced by __construct(), and initForm().

◆ $documentPurifier

ilAccessibilityDocumentFormGUI::$documentPurifier
protected

Definition at line 46 of file class.ilAccessibilityDocumentFormGUI.php.

Referenced by __construct().

◆ $fileUpload

ilAccessibilityDocumentFormGUI::$fileUpload
protected

Definition at line 22 of file class.ilAccessibilityDocumentFormGUI.php.

Referenced by __construct().

◆ $formAction

ilAccessibilityDocumentFormGUI::$formAction
protected

Definition at line 28 of file class.ilAccessibilityDocumentFormGUI.php.

Referenced by __construct().

◆ $isEditable

ilAccessibilityDocumentFormGUI::$isEditable = false
protected

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

Referenced by __construct().

◆ $saveCommand

ilAccessibilityDocumentFormGUI::$saveCommand
protected

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

Referenced by __construct().

◆ $tmpFileSystem

ilAccessibilityDocumentFormGUI::$tmpFileSystem
protected

Definition at line 25 of file class.ilAccessibilityDocumentFormGUI.php.

Referenced by __construct().

◆ $translatedError

ilAccessibilityDocumentFormGUI::$translatedError = ''
protected

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

Referenced by getTranslatedError().

◆ $translatedInfo

ilAccessibilityDocumentFormGUI::$translatedInfo = ''
protected

Definition at line 43 of file class.ilAccessibilityDocumentFormGUI.php.

Referenced by getTranslatedInfo().


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