ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCSSRectInputGUI Class Reference

This class represents a text property in a property form. More...

+ Inheritance diagram for ilCSSRectInputGUI:
+ Collaboration diagram for ilCSSRectInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setUseUnits ($a_value)
 Set use units.
 useUnits ()
 Get use units.
 setTop ($a_value)
 Set Top.
 getTop ()
 Get Top.
 setBottom ($a_value)
 Set Bottom.
 getBottom ()
 Get Bottom.
 setLeft ($a_value)
 Set Left.
 getLeft ()
 Get Left.
 setRight ($a_value)
 Set Right.
 getRight ()
 Get Right.
 setSize ($a_size)
 Set Size.
 setValueByArray ($a_values)
 Set value by array.
 getSize ()
 Get Size.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
 getItemByPostVar ($a_post_var)
 Get item by post var.
- Public Member Functions inherited from ilFormPropertyGUI
executeCommand ()
 Execute command.
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)

Protected Attributes

 $top
 $left
 $right
 $bottom
 $size
 $useUnits
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

This class represents a text property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilCSSRectInputGUI.php 18149 2008-12-03 10:03:05Z hschottm

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

Constructor & Destructor Documentation

ilCSSRectInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

References useUnits().

{
parent::__construct($a_title, $a_postvar);
$this->size = 6;
$this->useUnits = TRUE;
}

+ Here is the call graph for this function:

Member Function Documentation

ilCSSRectInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 188 of file class.ilCSSRectInputGUI.php.

References $_POST, $lng, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), ilUtil\stripSlashes(), and useUnits().

{
global $lng;
$_POST[$this->getPostVar()]["top"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["top"]);
$_POST[$this->getPostVar()]["right"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["right"]);
$_POST[$this->getPostVar()]["bottom"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["bottom"]);
$_POST[$this->getPostVar()]["left"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["left"]);
if ($this->getRequired() && ((trim($_POST[$this->getPostVar()]["top"]) == "") || (trim($_POST[$this->getPostVar()]["bottom"]) == "") || (trim($_POST[$this->getPostVar()]["left"]) == "") || (trim($_POST[$this->getPostVar()]["right"]) == "")))
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
if ($this->useUnits())
{
if ((!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["left"])) ||
(!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["right"])) ||
(!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["bottom"])) ||
(!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["top"])))
{
$this->setAlert($lng->txt("msg_unit_is_required"));
return false;
}
}
return $this->checkSubItemsInput();
}

+ Here is the call graph for this function:

ilCSSRectInputGUI::getBottom ( )

Get Bottom.

Returns
string Bottom

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

References $bottom.

Referenced by insert().

{
return $this->bottom;
}

+ Here is the caller graph for this function:

ilCSSRectInputGUI::getLeft ( )

Get Left.

Returns
string Left

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

References $left.

Referenced by insert().

{
return $this->left;
}

+ Here is the caller graph for this function:

ilCSSRectInputGUI::getRight ( )

Get Right.

Returns
string Right

Definition at line 148 of file class.ilCSSRectInputGUI.php.

References $right.

Referenced by insert().

{
return $this->right;
}

+ Here is the caller graph for this function:

ilCSSRectInputGUI::getSize ( )

Get Size.

Returns
int Size

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

References $size.

Referenced by insert().

{
return $this->size;
}

+ Here is the caller graph for this function:

ilCSSRectInputGUI::getTop ( )

Get Top.

Returns
string Top

Definition at line 88 of file class.ilCSSRectInputGUI.php.

References $top.

Referenced by insert().

{
return $this->top;
}

+ Here is the caller graph for this function:

ilCSSRectInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 220 of file class.ilCSSRectInputGUI.php.

References $lng, getBottom(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), getLeft(), ilFormPropertyGUI\getPostVar(), getRight(), getSize(), getTop(), and ilUtil\prepareFormOutput().

{
global $lng;
if (strlen($this->getTop()))
{
$a_tpl->setCurrentBlock("cssrect_value_top");
$a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getTop()));
$a_tpl->parseCurrentBlock();
}
if (strlen($this->getBottom()))
{
$a_tpl->setCurrentBlock("cssrect_value_bottom");
$a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getBottom()));
$a_tpl->parseCurrentBlock();
}
if (strlen($this->getLeft()))
{
$a_tpl->setCurrentBlock("cssrect_value_left");
$a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getLeft()));
$a_tpl->parseCurrentBlock();
}
if (strlen($this->getRight()))
{
$a_tpl->setCurrentBlock("cssrect_value_right");
$a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getRight()));
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("cssrect");
$a_tpl->setVariable("ID", $this->getFieldId());
$a_tpl->setVariable("SIZE", $this->getSize());
$a_tpl->setVariable("POST_VAR", $this->getPostVar());
$a_tpl->setVariable("TEXT_TOP", $lng->txt("pos_top"));
$a_tpl->setVariable("TEXT_RIGHT", $lng->txt("pos_right"));
$a_tpl->setVariable("TEXT_BOTTOM", $lng->txt("pos_bottom"));
$a_tpl->setVariable("TEXT_LEFT", $lng->txt("pos_left"));
if ($this->getDisabled())
{
$a_tpl->setVariable("DISABLED",
" disabled=\"disabled\"");
}
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilCSSRectInputGUI::setBottom (   $a_value)

Set Bottom.

Parameters
string$a_valueBottom

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

{
$this->bottom = $a_value;
}
ilCSSRectInputGUI::setLeft (   $a_value)

Set Left.

Parameters
string$a_valueLeft

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

{
$this->left = $a_value;
}
ilCSSRectInputGUI::setRight (   $a_value)

Set Right.

Parameters
string$a_valueRight

Definition at line 138 of file class.ilCSSRectInputGUI.php.

{
$this->right = $a_value;
}
ilCSSRectInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

{
$this->size = $a_size;
}
ilCSSRectInputGUI::setTop (   $a_value)

Set Top.

Parameters
string$a_valueTop

Definition at line 78 of file class.ilCSSRectInputGUI.php.

{
$this->top = $a_value;
}
ilCSSRectInputGUI::setUseUnits (   $a_value)

Set use units.

Parameters
boolean$a_valueUse units

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

References useUnits().

{
$this->useUnits = $a_value;
}

+ Here is the call graph for this function:

ilCSSRectInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 168 of file class.ilCSSRectInputGUI.php.

References ilFormPropertyGUI\getPostVar().

{
$this->setValue($a_values[$this->getPostVar()]);
}

+ Here is the call graph for this function:

ilCSSRectInputGUI::useUnits ( )

Get use units.

Returns
boolean use units

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

References $useUnits.

Referenced by __construct(), checkInput(), and setUseUnits().

{
}

+ Here is the caller graph for this function:

Field Documentation

ilCSSRectInputGUI::$bottom
protected

Definition at line 36 of file class.ilCSSRectInputGUI.php.

Referenced by getBottom().

ilCSSRectInputGUI::$left
protected

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

Referenced by getLeft().

ilCSSRectInputGUI::$right
protected

Definition at line 35 of file class.ilCSSRectInputGUI.php.

Referenced by getRight().

ilCSSRectInputGUI::$size
protected

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

Referenced by getSize().

ilCSSRectInputGUI::$top
protected

Definition at line 33 of file class.ilCSSRectInputGUI.php.

Referenced by getTop().

ilCSSRectInputGUI::$useUnits
protected

Definition at line 38 of file class.ilCSSRectInputGUI.php.

Referenced by useUnits().


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