ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilFormGUI Class Reference

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

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

Public Member Functions

 ilFormGUI ()
 Constructor. More...
 
 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 189 of file class.ilFormGUI.php.

190 {
191 return !$this->getKeepOpen();
192 }
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 287 of file class.ilFormGUI.php.

288 {
289 return "";
290 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getFormAction()

ilFormGUI::getFormAction ( )

Get FormAction.

Returns
string FormAction

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

50 {
51 return $this->formaction;
52 }

References $formaction.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHTML()

ilFormGUI::getHTML ( )

Get HTML.

Reimplemented in ilAsyncPropertyFormGUI, ilHierarchyFormGUI, and ilPropertyFormGUI.

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

218 {
219 $tpl = new ilTemplate("tpl.form.html", true, true, "Services/Form");
220
221 // this line also sets multipart, so it must be before the multipart check
222 $content = $this->getContent();
223 if ($this->getOpenTag())
224 {
225 $opentpl = new ilTemplate('tpl.form_open.html', true, true, "Services/Form");
226 if ($this->getTarget() != "")
227 {
228 $opentpl->setCurrentBlock("form_target");
229 $opentpl->setVariable("FORM_TARGET", $this->getTarget());
230 $opentpl->parseCurrentBlock();
231 }
232 if ($this->getName() != "")
233 {
234 $opentpl->setCurrentBlock("form_name");
235 $opentpl->setVariable("FORM_NAME", $this->getName());
236 $opentpl->parseCurrentBlock();
237 }
238 if ($this->getPreventDoubleSubmission())
239 {
240 $opentpl->setVariable("FORM_CLASS", "preventDoubleSubmission");
241 }
242
243 if ($this->getMultipart())
244 {
245 $opentpl->touchBlock("multipart");
246 /*if (function_exists("apc_fetch"))
247 //
248 // Progress bar would need additional browser window (popup)
249 // to not be stopped, when form is submitted (we can't work
250 // with an iframe or httprequest solution here)
251 //
252 {
253 $tpl->touchBlock("onsubmit");
254
255 //onsubmit="postForm('{ON_ACT}','form_{F_ID}',1); return false;"
256 $tpl->setCurrentBlock("onsubmit");
257 $tpl->setVariable("ON_ACT", $this->getFormAction());
258 $tpl->setVariable("F_ID", $this->getId());
259 $tpl->setVariable("F_ID", $this->getId());
260 $tpl->parseCurrentBlock();
261
262 $tpl->setCurrentBlock("hidden_progress");
263 $tpl->setVariable("APC_PROGRESS_ID", uniqid());
264 $tpl->setVariable("APC_FORM_ID", $this->getId());
265 $tpl->parseCurrentBlock();
266 }*/
267 }
268 $opentpl->setVariable("FORM_ACTION", $this->getFormAction());
269 if ($this->getId() != "")
270 {
271 $opentpl->setVariable("FORM_ID", $this->getId());
272 }
273 $opentpl->parseCurrentBlock();
274 $tpl->setVariable('FORM_OPEN_TAG', $opentpl->get());
275 }
276 $tpl->setVariable("FORM_CONTENT", $content);
277 if (!$this->getKeepOpen())
278 {
279 $tpl->setVariable("FORM_CLOSE_TAG", "</form>");
280 }
281 return $tpl->get();
282 }
global $tpl
Definition: ilias.php:8
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

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 109 of file class.ilFormGUI.php.

110 {
111 return $this->id;
112 }

References $id.

Referenced by 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 149 of file class.ilFormGUI.php.

150 {
151 return $this->keepopen;
152 }

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 89 of file class.ilFormGUI.php.

90 {
91 return $this->multipart;
92 }

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 129 of file class.ilFormGUI.php.

130 {
131 return $this->name;
132 }

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 169 of file class.ilFormGUI.php.

170 {
171 return $this->opentag;
172 }

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 209 of file class.ilFormGUI.php.

210 {
212 }

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 69 of file class.ilFormGUI.php.

70 {
71 return $this->target;
72 }

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ ilFormGUI()

ilFormGUI::ilFormGUI ( )

Constructor.

Parameters

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

31 {
32 }

◆ setCloseTag()

ilFormGUI::setCloseTag (   $a_val)

Set close tag.

Parameters
booleanclose tag true/false

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

180 {
181 $this->setKeepOpen(!$a_val);
182 }
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 99 of file class.ilFormGUI.php.

100 {
101 $this->id = $a_id;
102 }

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 139 of file class.ilFormGUI.php.

140 {
141 $this->keepopen = $a_keepopen;
142 }

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 79 of file class.ilFormGUI.php.

80 {
81 $this->multipart = $a_multipart;
82 }

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 119 of file class.ilFormGUI.php.

120 {
121 $this->name = $a_name;
122 }

◆ setOpenTag()

ilFormGUI::setOpenTag (   $a_open)

Enable/Disable Open Form Tag.

Parameters
boolean$a_keepopenenable/disable form open tag

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

160 {
161 $this->opentag = $a_open;
162 }

◆ setPreventDoubleSubmission()

ilFormGUI::setPreventDoubleSubmission (   $a_val)

Set prevent double submission.

Parameters
bool$a_valprevent double submission

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

200 {
201 $this->prevent_double_submission = $a_val;
202 }

Referenced by ilPropertyFormGUI\ilPropertyFormGUI().

+ Here is the caller graph for this function:

◆ setTarget()

ilFormGUI::setTarget (   $a_target)

Set Target.

Parameters
string$a_targetTarget

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

60 {
61 $this->target = $a_target;
62 }

Referenced by ilMemcacheServerFormGUI\initForm().

+ Here is the caller graph for this function:

Field Documentation

◆ $formaction

ilFormGUI::$formaction
protected

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

Referenced by getFormAction().

◆ $id

ilFormGUI::$id
protected

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

Referenced by ilAsyncPropertyFormGUI\addOnLoadCode(), and getId().

◆ $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

ilFormGUI::$name
protected

◆ $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: