ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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. More...
 
 setUseUnits ($a_value)
 Set use units. More...
 
 useUnits ()
 Get use units. More...
 
 setTop ($a_value)
 Set Top. More...
 
 getTop ()
 Get Top. More...
 
 setBottom ($a_value)
 Set Bottom. More...
 
 getBottom ()
 Get Bottom. More...
 
 setLeft ($a_value)
 Set Left. More...
 
 getLeft ()
 Get Left. More...
 
 setRight ($a_value)
 Set Right. More...
 
 getRight ()
 Get Right. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 

Protected Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

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$

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $DIC, size, and useUnits().

52  {
53  global $DIC;
54 
55  $this->lng = $DIC->language();
56  parent::__construct($a_title, $a_postvar);
57  $this->size = 6;
58  $this->useUnits = true;
59  }
global $DIC
Definition: saml.php:7
Set page orientation and size
Definition: 04printing.php:77
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilCSSRectInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

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

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

197  {
198  $lng = $this->lng;
199 
200  $_POST[$this->getPostVar()]["top"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["top"]);
201  $_POST[$this->getPostVar()]["right"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["right"]);
202  $_POST[$this->getPostVar()]["bottom"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["bottom"]);
203  $_POST[$this->getPostVar()]["left"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["left"]);
204  if ($this->getRequired() && ((trim($_POST[$this->getPostVar()]["top"]) == "") || (trim($_POST[$this->getPostVar()]["bottom"]) == "") || (trim($_POST[$this->getPostVar()]["left"]) == "") || (trim($_POST[$this->getPostVar()]["right"]) == ""))) {
205  $this->setAlert($lng->txt("msg_input_is_required"));
206  return false;
207  }
208  if ($this->useUnits()) {
209  if ((!preg_match('/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $_POST[$this->getPostVar()]["left"])) ||
210  (!preg_match('/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $_POST[$this->getPostVar()]["right"])) ||
211  (!preg_match('/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $_POST[$this->getPostVar()]["bottom"])) ||
212  (!preg_match('/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*))|0)(cm|mm|in|pt|pc|px|em)$/is', $_POST[$this->getPostVar()]["top"]))) {
213  $this->setAlert($lng->txt("msg_unit_is_required"));
214  return false;
215  }
216  }
217  return $this->checkSubItemsInput();
218  }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ getBottom()

ilCSSRectInputGUI::getBottom ( )

Get Bottom.

Returns
string Bottom

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

References $bottom.

Referenced by insert().

117  {
118  return $this->bottom;
119  }
+ Here is the caller graph for this function:

◆ getLeft()

ilCSSRectInputGUI::getLeft ( )

Get Left.

Returns
string Left

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

References $left.

Referenced by insert().

137  {
138  return $this->left;
139  }
+ Here is the caller graph for this function:

◆ getRight()

ilCSSRectInputGUI::getRight ( )

Get Right.

Returns
string Right

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

References $right.

Referenced by insert().

157  {
158  return $this->right;
159  }
+ Here is the caller graph for this function:

◆ getSize()

ilCSSRectInputGUI::getSize ( )

Get Size.

Returns
int Size

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

References $size.

Referenced by insert().

187  {
188  return $this->size;
189  }
+ Here is the caller graph for this function:

◆ getTop()

ilCSSRectInputGUI::getTop ( )

Get Top.

Returns
string Top

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

References $top.

Referenced by insert().

97  {
98  return $this->top;
99  }
+ Here is the caller graph for this function:

◆ insert()

ilCSSRectInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

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

226  {
227  $lng = $this->lng;
228 
229  if (strlen($this->getTop())) {
230  $a_tpl->setCurrentBlock("cssrect_value_top");
231  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getTop()));
232  $a_tpl->parseCurrentBlock();
233  }
234  if (strlen($this->getBottom())) {
235  $a_tpl->setCurrentBlock("cssrect_value_bottom");
236  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getBottom()));
237  $a_tpl->parseCurrentBlock();
238  }
239  if (strlen($this->getLeft())) {
240  $a_tpl->setCurrentBlock("cssrect_value_left");
241  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getLeft()));
242  $a_tpl->parseCurrentBlock();
243  }
244  if (strlen($this->getRight())) {
245  $a_tpl->setCurrentBlock("cssrect_value_right");
246  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getRight()));
247  $a_tpl->parseCurrentBlock();
248  }
249  $a_tpl->setCurrentBlock("cssrect");
250  $a_tpl->setVariable("ID", $this->getFieldId());
251  $a_tpl->setVariable("SIZE", $this->getSize());
252  $a_tpl->setVariable("POST_VAR", $this->getPostVar());
253  $a_tpl->setVariable("TEXT_TOP", $lng->txt("pos_top"));
254  $a_tpl->setVariable("TEXT_RIGHT", $lng->txt("pos_right"));
255  $a_tpl->setVariable("TEXT_BOTTOM", $lng->txt("pos_bottom"));
256  $a_tpl->setVariable("TEXT_LEFT", $lng->txt("pos_left"));
257  if ($this->getDisabled()) {
258  $a_tpl->setVariable(
259  "DISABLED",
260  " disabled=\"disabled\""
261  );
262  }
263  $a_tpl->parseCurrentBlock();
264  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getPostVar()
Get Post Variable.
getFieldId()
Get Post Variable.
+ Here is the call graph for this function:

◆ setBottom()

ilCSSRectInputGUI::setBottom (   $a_value)

Set Bottom.

Parameters
string$a_valueBottom

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

107  {
108  $this->bottom = $a_value;
109  }

◆ setLeft()

ilCSSRectInputGUI::setLeft (   $a_value)

Set Left.

Parameters
string$a_valueLeft

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

127  {
128  $this->left = $a_value;
129  }

◆ setRight()

ilCSSRectInputGUI::setRight (   $a_value)

Set Right.

Parameters
string$a_valueRight

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

147  {
148  $this->right = $a_value;
149  }

◆ setSize()

ilCSSRectInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

References size.

167  {
168  $this->size = $a_size;
169  }
Set page orientation and size
Definition: 04printing.php:77

◆ setTop()

ilCSSRectInputGUI::setTop (   $a_value)

Set Top.

Parameters
string$a_valueTop

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

References top.

87  {
88  $this->top = $a_value;
89  }
Rows to repeat at top

◆ setUseUnits()

ilCSSRectInputGUI::setUseUnits (   $a_value)

Set use units.

Parameters
boolean$a_valueUse units

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

References useUnits().

67  {
68  $this->useUnits = $a_value;
69  }
+ Here is the call graph for this function:

◆ setValueByArray()

ilCSSRectInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

References ilFormPropertyGUI\getPostVar().

177  {
178  $this->setValue($a_values[$this->getPostVar()]);
179  }
getPostVar()
Get Post Variable.
+ Here is the call graph for this function:

◆ useUnits()

ilCSSRectInputGUI::useUnits ( )

Get use units.

Returns
boolean use units

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

References $useUnits.

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

77  {
78  return $this->useUnits;
79  }
+ Here is the caller graph for this function:

Field Documentation

◆ $bottom

ilCSSRectInputGUI::$bottom
protected

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

Referenced by getBottom().

◆ $left

ilCSSRectInputGUI::$left
protected

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

Referenced by getLeft().

◆ $lng

ilCSSRectInputGUI::$lng
protected

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

Referenced by checkInput(), and insert().

◆ $right

ilCSSRectInputGUI::$right
protected

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

Referenced by getRight().

◆ $size

ilCSSRectInputGUI::$size
protected

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

Referenced by getSize().

◆ $top

ilCSSRectInputGUI::$top
protected

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

Referenced by getTop().

◆ $useUnits

ilCSSRectInputGUI::$useUnits
protected

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

Referenced by useUnits().


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