ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 setValue ($valueArray)
 
 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...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. 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
font size
Definition: langcheck.php:162
+ 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 213 of file class.ilCSSRectInputGUI.php.

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

214  {
215  $lng = $this->lng;
216 
217  $_POST[$this->getPostVar() . '_top'] = ilUtil::stripSlashes($_POST[$this->getPostVar()]['top']);
218  $_POST[$this->getPostVar() . '_right'] = ilUtil::stripSlashes($_POST[$this->getPostVar()]['right']);
219  $_POST[$this->getPostVar() . '_bottom'] = ilUtil::stripSlashes($_POST[$this->getPostVar()]['bottom']);
220  $_POST[$this->getPostVar() . '_left'] = ilUtil::stripSlashes($_POST[$this->getPostVar()]['left']);
221 
222  if (
223  $this->getRequired() &&
224  (
225  (trim($_POST[$this->getPostVar() . '_top'] == ""))
226  || (trim($_POST[$this->getPostVar() . '_bottom']) == "")
227  || (trim($_POST[$this->getPostVar() . '_left']) == "")
228  || (trim($_POST[$this->getPostVar() . '_right']) == "")
229  )
230  ) {
231  $this->setAlert($lng->txt("msg_input_is_required"));
232  return false;
233  }
234 
235  if ($this->useUnits()) {
236  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() . '_top'])) ||
237  (!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'])) ||
238  (!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'])) ||
239  (!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']))) {
240  $this->setAlert($lng->txt("msg_unit_is_required"));
241  return false;
242  }
243  }
244  return $this->checkSubItemsInput();
245  }
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 124 of file class.ilCSSRectInputGUI.php.

References $bottom.

Referenced by insert().

125  {
126  return $this->bottom;
127  }
+ Here is the caller graph for this function:

◆ getLeft()

ilCSSRectInputGUI::getLeft ( )

Get Left.

Returns
string Left

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

References $left.

Referenced by insert().

145  {
146  return $this->left;
147  }
+ Here is the caller graph for this function:

◆ getRight()

ilCSSRectInputGUI::getRight ( )

Get Right.

Returns
string Right

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

References $right.

Referenced by insert().

165  {
166  return $this->right;
167  }
+ Here is the caller graph for this function:

◆ getSize()

ilCSSRectInputGUI::getSize ( )

Get Size.

Returns
int Size

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

References $size.

Referenced by insert().

204  {
205  return $this->size;
206  }
+ Here is the caller graph for this function:

◆ getTop()

ilCSSRectInputGUI::getTop ( )

Get Top.

Returns
string Top

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

References $top.

Referenced by insert().

105  {
106  return $this->top;
107  }
+ Here is the caller graph for this function:

◆ insert()

ilCSSRectInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

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

253  {
254  $lng = $this->lng;
255 
256  if (strlen($this->getTop())) {
257  $a_tpl->setCurrentBlock("cssrect_value_top");
258  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getTop()));
259  $a_tpl->parseCurrentBlock();
260  }
261  if (strlen($this->getBottom())) {
262  $a_tpl->setCurrentBlock("cssrect_value_bottom");
263  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getBottom()));
264  $a_tpl->parseCurrentBlock();
265  }
266  if (strlen($this->getLeft())) {
267  $a_tpl->setCurrentBlock("cssrect_value_left");
268  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getLeft()));
269  $a_tpl->parseCurrentBlock();
270  }
271  if (strlen($this->getRight())) {
272  $a_tpl->setCurrentBlock("cssrect_value_right");
273  $a_tpl->setVariable("CSSRECT_VALUE", ilUtil::prepareFormOutput($this->getRight()));
274  $a_tpl->parseCurrentBlock();
275  }
276  $a_tpl->setCurrentBlock("cssrect");
277  $a_tpl->setVariable("ID", $this->getFieldId());
278  $a_tpl->setVariable("SIZE", $this->getSize());
279  $a_tpl->setVariable("POST_VAR", $this->getPostVar());
280  $a_tpl->setVariable("TEXT_TOP", $lng->txt("pos_top"));
281  $a_tpl->setVariable("TEXT_RIGHT", $lng->txt("pos_right"));
282  $a_tpl->setVariable("TEXT_BOTTOM", $lng->txt("pos_bottom"));
283  $a_tpl->setVariable("TEXT_LEFT", $lng->txt("pos_left"));
284  if ($this->getDisabled()) {
285  $a_tpl->setVariable(
286  "DISABLED",
287  " disabled=\"disabled\""
288  );
289  }
290  $a_tpl->parseCurrentBlock();
291  }
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 114 of file class.ilCSSRectInputGUI.php.

115  {
116  $this->bottom = $a_value;
117  }

◆ setLeft()

ilCSSRectInputGUI::setLeft (   $a_value)

Set Left.

Parameters
string$a_valueLeft

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

References left.

135  {
136  $this->left = $a_value;
137  }
margin left
Definition: langcheck.php:164

◆ setRight()

ilCSSRectInputGUI::setRight (   $a_value)

Set Right.

Parameters
string$a_valueRight

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

155  {
156  $this->right = $a_value;
157  }

◆ setSize()

ilCSSRectInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

References size.

175  {
176  $this->size = $a_size;
177  }
font size
Definition: langcheck.php:162

◆ setTop()

ilCSSRectInputGUI::setTop (   $a_value)

Set Top.

Parameters
string$a_valueTop

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

95  {
96  $this->top = $a_value;
97  }

◆ setUseUnits()

ilCSSRectInputGUI::setUseUnits (   $a_value)

Set use units.

Parameters
boolean$a_valueUse units

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

References useUnits().

75  {
76  $this->useUnits = $a_value;
77  }
+ Here is the call graph for this function:

◆ setValue()

ilCSSRectInputGUI::setValue (   $valueArray)

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

References left.

Referenced by setValueByArray().

62  {
63  $this->top = $valueArray['top'];
64  $this->left = $valueArray['left'];
65  $this->right = $valueArray['right'];
66  $this->bottom = $valueArray['bottom'];
67  }
margin left
Definition: langcheck.php:164
+ Here is the caller graph for this function:

◆ setValueByArray()

ilCSSRectInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

References $values, ilFormPropertyGUI\getPostVar(), and setValue().

185  {
186  $postVar = $this->getPostVar();
187 
188  $values = array(
189  'top' => $a_values[$postVar . '_top'],
190  'bottom' => $a_values[$postVar . '_bottom'],
191  'right' => $a_values[$postVar . '_right'],
192  'left' => $a_values[$postVar . '_left'],
193  );
194 
195  $this->setValue($values);
196  }
getPostVar()
Get Post Variable.
$values
+ Here is the call graph for this function:

◆ useUnits()

ilCSSRectInputGUI::useUnits ( )

Get use units.

Returns
boolean use units

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

References $useUnits.

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

85  {
86  return $this->useUnits;
87  }
+ 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: