ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Protected Attributes

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

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

References getKeepOpen().

189  {
190  return !$this->getKeepOpen();
191  }
getKeepOpen()
Get Keep Form Tag Open.
+ Here is the call graph for this function:

◆ getContent()

ilFormGUI::getContent ( )

Get Content.

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

Referenced by getHTML().

262  {
263  return "";
264  }
+ Here is the caller graph for this function:

◆ getFormAction()

ilFormGUI::getFormAction ( )

Get FormAction.

Returns
string FormAction

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

References $formaction.

Referenced by getHTML().

49  {
50  return $this->formaction;
51  }
+ Here is the caller graph for this function:

◆ getHTML()

ilFormGUI::getHTML ( )

Get HTML.

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

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

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

◆ getId()

ilFormGUI::getId ( )

Get Id.

Returns
string Id

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

References $id.

Referenced by getHTML().

109  {
110  return $this->id;
111  }
+ 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 148 of file class.ilFormGUI.php.

References $keepopen.

Referenced by getCloseTag(), and getHTML().

149  {
150  return $this->keepopen;
151  }
+ 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 88 of file class.ilFormGUI.php.

References $multipart.

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

89  {
90  return $this->multipart;
91  }
+ Here is the caller graph for this function:

◆ getName()

ilFormGUI::getName ( )

Get Name.

Returns
string Name

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

References $name.

Referenced by getHTML().

129  {
130  return $this->name;
131  }
+ 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 168 of file class.ilFormGUI.php.

References $opentag.

Referenced by getHTML().

169  {
170  return $this->opentag;
171  }
+ Here is the caller graph for this function:

◆ getTarget()

ilFormGUI::getTarget ( )

Get Target.

Returns
string Target

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

Referenced by getHTML().

69  {
70  return $this->target;
71  }
+ Here is the caller graph for this function:

◆ ilFormGUI()

ilFormGUI::ilFormGUI ( )

Constructor.

Parameters

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

30  {
31  }

◆ setCloseTag()

ilFormGUI::setCloseTag (   $a_val)

Set close tag.

Parameters
booleanclose tag true/false

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

References setKeepOpen().

179  {
180  $this->setKeepOpen(!$a_val);
181  }
setKeepOpen($a_keepopen)
Set Keep Form Tag Open.
+ Here is the call graph for this function:

◆ setFormAction()

ilFormGUI::setFormAction (   $a_formaction)

◆ setId()

ilFormGUI::setId (   $a_id)

Set Id.

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

Parameters
string$a_idId

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

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

99  {
100  $this->id = $a_id;
101  }
+ 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 138 of file class.ilFormGUI.php.

Referenced by setCloseTag().

139  {
140  $this->keepopen = $a_keepopen;
141  }
+ 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 78 of file class.ilFormGUI.php.

Referenced by assOrderingQuestionGUI\editQuestion(), and ilPropertyFormGUI\insertItem().

79  {
80  $this->multipart = $a_multipart;
81  }
+ Here is the caller graph for this function:

◆ setName()

ilFormGUI::setName (   $a_name)

Set Name.

Useful for Javascript

Parameters
string$a_nameName

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

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

◆ setOpenTag()

ilFormGUI::setOpenTag (   $a_open)

Enable/Disable Open Form Tag.

Parameters
boolean$a_keepopenenable/disable form open tag

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

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

◆ setTarget()

ilFormGUI::setTarget (   $a_target)

Set Target.

Parameters
string$a_targetTarget

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

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

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

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

Referenced by getName(), and ilPropertyFormGUI\rebuildUploadedFiles().

◆ $opentag

ilFormGUI::$opentag = true
protected

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

Referenced by getOpenTag().


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