ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilFormGUI Class Reference

This class represents a form user interface. More...

+ Inheritance diagram for ilFormGUI:
+ Collaboration diagram for ilFormGUI:

Public Member Functions

 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 Attributes

 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Detailed Description

This class represents a form user interface.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

◆ getCloseTag()

ilFormGUI::getCloseTag ( )

Get close tag.

Returns
boolean close tag true/false

Definition at line 180 of file class.ilFormGUI.php.

181 {
182 return !$this->getKeepOpen();
183 }
getKeepOpen()
Get Keep Form Tag Open.

References getKeepOpen().

+ Here is the call graph for this function:

◆ getContent()

ilFormGUI::getContent ( )

Get Content.

Reimplemented in ilHierarchyFormGUI, and ilPropertyFormGUI.

Definition at line 271 of file class.ilFormGUI.php.

272 {
273 return "";
274 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getFormAction()

ilFormGUI::getFormAction ( )

◆ getHTML()

ilFormGUI::getHTML ( )

Get HTML.

Reimplemented in ilLTIConsumerProviderSelectionFormTableGUI, ilAsyncPropertyFormGUI, ilHierarchyFormGUI, and ilPropertyFormGUI.

Definition at line 208 of file class.ilFormGUI.php.

209 {
210 $tpl = new ilTemplate("tpl.form.html", true, true, "Services/Form");
211
212 // this line also sets multipart, so it must be before the multipart check
213 $content = $this->getContent();
214 if ($this->getOpenTag()) {
215 $opentpl = new ilTemplate('tpl.form_open.html', true, true, "Services/Form");
216 if ($this->getTarget() != "") {
217 $opentpl->setCurrentBlock("form_target");
218 $opentpl->setVariable("FORM_TARGET", $this->getTarget());
219 $opentpl->parseCurrentBlock();
220 }
221 if ($this->getName() != "") {
222 $opentpl->setCurrentBlock("form_name");
223 $opentpl->setVariable("FORM_NAME", $this->getName());
224 $opentpl->parseCurrentBlock();
225 }
226 if ($this->getPreventDoubleSubmission()) {
227 $opentpl->setVariable("FORM_CLASS", "preventDoubleSubmission");
228 }
229
230 if ($this->getMultipart()) {
231 $opentpl->touchBlock("multipart");
232 /*if (function_exists("apc_fetch"))
233 //
234 // Progress bar would need additional browser window (popup)
235 // to not be stopped, when form is submitted (we can't work
236 // with an iframe or httprequest solution here)
237 //
238 {
239 $tpl->touchBlock("onsubmit");
240
241 //onsubmit="postForm('{ON_ACT}','form_{F_ID}',1); return false;"
242 $tpl->setCurrentBlock("onsubmit");
243 $tpl->setVariable("ON_ACT", $this->getFormAction());
244 $tpl->setVariable("F_ID", $this->getId());
245 $tpl->setVariable("F_ID", $this->getId());
246 $tpl->parseCurrentBlock();
247
248 $tpl->setCurrentBlock("hidden_progress");
249 $tpl->setVariable("APC_PROGRESS_ID", uniqid());
250 $tpl->setVariable("APC_FORM_ID", $this->getId());
251 $tpl->parseCurrentBlock();
252 }*/
253 }
254 $opentpl->setVariable("FORM_ACTION", $this->getFormAction());
255 if ($this->getId() != "") {
256 $opentpl->setVariable("FORM_ID", $this->getId());
257 }
258 $opentpl->parseCurrentBlock();
259 $tpl->setVariable('FORM_OPEN_TAG', $opentpl->get());
260 }
261 $tpl->setVariable("FORM_CONTENT", $content);
262 if (!$this->getKeepOpen()) {
263 $tpl->setVariable("FORM_CLOSE_TAG", "</form>");
264 }
265 return $tpl->get();
266 }
getPreventDoubleSubmission()
Get prevent double submission.
getName()
Get Name.
getMultipart()
Get Enctype Multipart/Formdata true/false.
getTarget()
Get Target.
getOpenTag()
Get Open Form Tag Enabled.
getContent()
Get Content.
getFormAction()
Get FormAction.
getId()
Get Id.
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl

References $tpl, getContent(), getFormAction(), getId(), getKeepOpen(), getMultipart(), getName(), getOpenTag(), getPreventDoubleSubmission(), and getTarget().

+ Here is the call graph for this function:

◆ getId()

ilFormGUI::getId ( )

Get Id.

Returns
string Id

Reimplemented in ilHierarchyFormGUI.

Definition at line 100 of file class.ilFormGUI.php.

101 {
102 return $this->id;
103 }

References $id.

Referenced by ilObjForumGUI\decorateWithAutosave(), and getHTML().

+ Here is the caller graph for this function:

◆ getKeepOpen()

ilFormGUI::getKeepOpen ( )

Get Keep Form Tag Open.

Returns
boolean Keep Form Tag Open

Definition at line 140 of file class.ilFormGUI.php.

141 {
142 return $this->keepopen;
143 }

References $keepopen.

Referenced by getCloseTag(), and getHTML().

+ Here is the caller graph for this function:

◆ getMultipart()

ilFormGUI::getMultipart ( )

Get Enctype Multipart/Formdata true/false.

Returns
boolean Enctype Multipart/Formdata true/false

Definition at line 80 of file class.ilFormGUI.php.

81 {
82 return $this->multipart;
83 }

References $multipart.

Referenced by ilPropertyFormGUI\getContent(), and getHTML().

+ Here is the caller graph for this function:

◆ getName()

ilFormGUI::getName ( )

Get Name.

Returns
string Name

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

121 {
122 return $this->name;
123 }

References $name.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getOpenTag()

ilFormGUI::getOpenTag ( )

Get Open Form Tag Enabled.

Returns
boolean open form tag enabled

Definition at line 160 of file class.ilFormGUI.php.

161 {
162 return $this->opentag;
163 }

References $opentag.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getPreventDoubleSubmission()

ilFormGUI::getPreventDoubleSubmission ( )

Get prevent double submission.

Returns
bool prevent double submission

Definition at line 200 of file class.ilFormGUI.php.

201 {
203 }

References $prevent_double_submission.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getTarget()

ilFormGUI::getTarget ( )

Get Target.

Returns
string Target

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

61 {
62 return $this->target;
63 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ setCloseTag()

ilFormGUI::setCloseTag (   $a_val)

Set close tag.

Parameters
booleanclose tag true/false

Definition at line 170 of file class.ilFormGUI.php.

171 {
172 $this->setKeepOpen(!$a_val);
173 }
setKeepOpen($a_keepopen)
Set Keep Form Tag Open.

References setKeepOpen().

+ Here is the call graph for this function:

◆ setFormAction()

◆ setId()

ilFormGUI::setId (   $a_id)

Set Id.

If you use multiple forms on a screen you should set this value.

Parameters
string$a_idId

Reimplemented in ilHierarchyFormGUI.

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

91 {
92 $this->id = $a_id;
93 }

Referenced by ilTestRandomQuestionSetGeneralConfigFormGUI\build(), and ilTestRandomQuestionSetPoolDefinitionFormGUI\build().

+ Here is the caller graph for this function:

◆ setKeepOpen()

ilFormGUI::setKeepOpen (   $a_keepopen)

Set Keep Form Tag Open.

Parameters
boolean$a_keepopenKeep Form Tag Open

Definition at line 130 of file class.ilFormGUI.php.

131 {
132 $this->keepopen = $a_keepopen;
133 }

Referenced by setCloseTag().

+ Here is the caller graph for this function:

◆ setMultipart()

ilFormGUI::setMultipart (   $a_multipart)

Set Enctype Multipart/Formdata true/false.

Parameters
boolean$a_multipartEnctype Multipart/Formdata true/false

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

71 {
72 $this->multipart = $a_multipart;
73 }

Referenced by ilPropertyFormGUI\insertItem().

+ Here is the caller graph for this function:

◆ setName()

ilFormGUI::setName (   $a_name)

Set Name.

Useful for Javascript

Parameters
string$a_nameName

Reimplemented in ilAsyncPropertyFormGUI.

Definition at line 110 of file class.ilFormGUI.php.

111 {
112 $this->name = $a_name;
113 }

◆ setOpenTag()

ilFormGUI::setOpenTag (   $a_open)

Enable/Disable Open Form Tag.

Parameters
boolean$a_keepopenenable/disable form open tag

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

151 {
152 $this->opentag = $a_open;
153 }

◆ setPreventDoubleSubmission()

ilFormGUI::setPreventDoubleSubmission (   $a_val)

Set prevent double submission.

Parameters
bool$a_valprevent double submission

Definition at line 190 of file class.ilFormGUI.php.

191 {
192 $this->prevent_double_submission = $a_val;
193 }

Referenced by ilPropertyFormGUI\__construct().

+ Here is the caller graph for this function:

◆ setTarget()

ilFormGUI::setTarget (   $a_target)

Set Target.

Parameters
string$a_targetTarget

Definition at line 50 of file class.ilFormGUI.php.

51 {
52 $this->target = $a_target;
53 }

Referenced by ILIAS\Modules\OrgUnit\ARHelper\BaseForm\__construct(), ilOrgUnitDefaultPermissionFormGUI\__construct(), ilFileVersionFormGUI\__construct(), ilBiblFieldFilterFormGUI\initForm(), and ilMemcacheServerFormGUI\initForm().

+ Here is the caller graph for this function:

Field Documentation

◆ $formaction

◆ $id

◆ $keepopen

ilFormGUI::$keepopen = false
protected

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

Referenced by getKeepOpen().

◆ $multipart

ilFormGUI::$multipart = false
protected

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

Referenced by getMultipart().

◆ $name

◆ $opentag

ilFormGUI::$opentag = true
protected

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

Referenced by getOpenTag().

◆ $prevent_double_submission

ilFormGUI::$prevent_double_submission = false
protected

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

Referenced by getPreventDoubleSubmission().


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