ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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.
 setFormAction ($a_formaction)
 Set FormAction.
 getFormAction ()
 Get FormAction.
 setTarget ($a_target)
 Set Target.
 getTarget ()
 Get Target.
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false.
 getMultipart ()
 Get Enctype Multipart/Formdata true/false.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setName ($a_name)
 Set Name.
 getName ()
 Get Name.
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open.
 getKeepOpen ()
 Get Keep Form Tag Open.
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag.
 getOpenTag ()
 Get Open Form Tag Enabled.
 setCloseTag ($a_val)
 Set close tag.
 getCloseTag ()
 Get close tag.
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission.
 getPreventDoubleSubmission ()
 Get prevent double submission.
 getHTML ()
 Get HTML.
 getContent ()
 Get Content.

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

ilFormGUI::getCloseTag ( )

Get close tag.

Returns
boolean close tag true/false

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

References getKeepOpen().

{
return !$this->getKeepOpen();
}

+ Here is the call graph for this function:

ilFormGUI::getContent ( )

Get Content.

Reimplemented in ilPropertyFormGUI, and ilHierarchyFormGUI.

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

Referenced by getHTML().

{
return "";
}

+ Here is the caller graph for this function:

ilFormGUI::getFormAction ( )

Get FormAction.

Returns
string FormAction

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

References $formaction.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilFormGUI::getHTML ( )

Get HTML.

Reimplemented in ilHierarchyFormGUI, and ilPropertyFormGUI.

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

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

{
$tpl = new ilTemplate("tpl.form.html", true, true, "Services/Form");
// this line also sets multipart, so it must be before the multipart check
$content = $this->getContent();
if ($this->getOpenTag())
{
$opentpl = new ilTemplate('tpl.form_open.html', true, true, "Services/Form");
if ($this->getTarget() != "")
{
$opentpl->setCurrentBlock("form_target");
$opentpl->setVariable("FORM_TARGET", $this->getTarget());
$opentpl->parseCurrentBlock();
}
if ($this->getName() != "")
{
$opentpl->setCurrentBlock("form_name");
$opentpl->setVariable("FORM_NAME", $this->getName());
$opentpl->parseCurrentBlock();
}
{
$opentpl->setVariable("FORM_CLASS", "preventDoubleSubmission");
}
if ($this->getMultipart())
{
$opentpl->touchBlock("multipart");
/*if (function_exists("apc_fetch"))
//
// Progress bar would need additional browser window (popup)
// to not be stopped, when form is submitted (we can't work
// with an iframe or httprequest solution here)
//
{
$tpl->touchBlock("onsubmit");
//onsubmit="postForm('{ON_ACT}','form_{F_ID}',1); return false;"
$tpl->setCurrentBlock("onsubmit");
$tpl->setVariable("ON_ACT", $this->getFormAction());
$tpl->setVariable("F_ID", $this->getId());
$tpl->setVariable("F_ID", $this->getId());
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("hidden_progress");
$tpl->setVariable("APC_PROGRESS_ID", uniqid());
$tpl->setVariable("APC_FORM_ID", $this->getId());
$tpl->parseCurrentBlock();
}*/
}
$opentpl->setVariable("FORM_ACTION", $this->getFormAction());
if ($this->getId() != "")
{
$opentpl->setVariable("FORM_ID", $this->getId());
}
$opentpl->parseCurrentBlock();
$tpl->setVariable('FORM_OPEN_TAG', $opentpl->get());
}
$tpl->setVariable("FORM_CONTENT", $content);
if (!$this->getKeepOpen())
{
$tpl->setVariable("FORM_CLOSE_TAG", "</form>");
}
return $tpl->get();
}

+ Here is the call graph for this function:

ilFormGUI::getId ( )

Get Id.

Returns
string Id

Reimplemented in ilHierarchyFormGUI.

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

References $id.

Referenced by getHTML().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilFormGUI::getKeepOpen ( )

Get Keep Form Tag Open.

Returns
boolean Keep Form Tag Open

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

References $keepopen.

Referenced by getCloseTag(), and getHTML().

{
}

+ Here is the caller graph for this function:

ilFormGUI::getMultipart ( )

Get Enctype Multipart/Formdata true/false.

Returns
boolean Enctype Multipart/Formdata true/false

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

References $multipart.

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

{
}

+ Here is the caller graph for this function:

ilFormGUI::getName ( )

Get Name.

Returns
string Name

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

References $name.

Referenced by getHTML().

{
return $this->name;
}

+ Here is the caller graph for this function:

ilFormGUI::getOpenTag ( )

Get Open Form Tag Enabled.

Returns
boolean open form tag enabled

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

References $opentag.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilFormGUI::getPreventDoubleSubmission ( )

Get prevent double submission.

Returns
bool prevent double submission

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

References $prevent_double_submission.

Referenced by getHTML().

+ Here is the caller graph for this function:

ilFormGUI::getTarget ( )

Get Target.

Returns
string Target

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

Referenced by getHTML().

{
return $this->target;
}

+ Here is the caller graph for this function:

ilFormGUI::ilFormGUI ( )

Constructor.

Parameters

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

Referenced by ilHierarchyFormGUI\__construct(), and ilPropertyFormGUI\ilPropertyFormGUI().

{
}

+ Here is the caller graph for this function:

ilFormGUI::setCloseTag (   $a_val)

Set close tag.

Parameters
booleanclose tag true/false

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

References setKeepOpen().

{
$this->setKeepOpen(!$a_val);
}

+ Here is the call graph for this function:

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.

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

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

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.

Referenced by setCloseTag().

{
$this->keepopen = $a_keepopen;
}

+ Here is the caller graph for this function:

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.

Referenced by ilPropertyFormGUI\insertItem().

{
$this->multipart = $a_multipart;
}

+ Here is the caller graph for this function:

ilFormGUI::setName (   $a_name)

Set Name.

Useful for Javascript

Parameters
string$a_nameName

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

{
$this->name = $a_name;
}
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.

{
$this->opentag = $a_open;
}
ilFormGUI::setPreventDoubleSubmission (   $a_val)

Set prevent double submission.

Parameters
bool$a_valprevent double submission

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

Referenced by ilPropertyFormGUI\ilPropertyFormGUI().

{
$this->prevent_double_submission = $a_val;
}

+ Here is the caller graph for this function:

ilFormGUI::setTarget (   $a_target)

Set Target.

Parameters
string$a_targetTarget

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

{
$this->target = $a_target;
}

Field Documentation

ilFormGUI::$formaction
protected

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

Referenced by getFormAction().

ilFormGUI::$id
protected

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

Referenced by getId().

ilFormGUI::$keepopen = false
protected

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

Referenced by getKeepOpen().

ilFormGUI::$multipart = false
protected

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

Referenced by getMultipart().

ilFormGUI::$name
protected
ilFormGUI::$opentag = true
protected

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

Referenced by getOpenTag().

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: