ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 

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 = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- 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

Reimplemented from ilFormPropertyGUI.

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

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

References useUnits().

+ 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

Reimplemented from ilFormPropertyGUI.

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

189 {
190 global $lng;
191
192 $_POST[$this->getPostVar()]["top"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["top"]);
193 $_POST[$this->getPostVar()]["right"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["right"]);
194 $_POST[$this->getPostVar()]["bottom"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["bottom"]);
195 $_POST[$this->getPostVar()]["left"] = ilUtil::stripSlashes($_POST[$this->getPostVar()]["left"]);
196 if ($this->getRequired() && ((trim($_POST[$this->getPostVar()]["top"]) == "") || (trim($_POST[$this->getPostVar()]["bottom"]) == "") || (trim($_POST[$this->getPostVar()]["left"]) == "") || (trim($_POST[$this->getPostVar()]["right"]) == "")))
197 {
198 $this->setAlert($lng->txt("msg_input_is_required"));
199 return false;
200 }
201 if ($this->useUnits())
202 {
203 if ((!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["left"])) ||
204 (!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["right"])) ||
205 (!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["bottom"])) ||
206 (!preg_match("/\\d+(cm|mm|in|pt|pc|px|em)/", $_POST[$this->getPostVar()]["top"])))
207 {
208 $this->setAlert($lng->txt("msg_unit_is_required"));
209 return false;
210 }
211 }
212 return $this->checkSubItemsInput();
213 }
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']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40

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

+ Here is the call graph for this function:

◆ getBottom()

ilCSSRectInputGUI::getBottom ( )

Get Bottom.

Returns
string Bottom

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

109 {
110 return $this->bottom;
111 }

References $bottom.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getLeft()

ilCSSRectInputGUI::getLeft ( )

Get Left.

Returns
string Left

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

129 {
130 return $this->left;
131 }

References $left.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getRight()

ilCSSRectInputGUI::getRight ( )

Get Right.

Returns
string Right

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

149 {
150 return $this->right;
151 }

References $right.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getSize()

ilCSSRectInputGUI::getSize ( )

Get Size.

Returns
int Size

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

179 {
180 return $this->size;
181 }

References $size.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getTop()

ilCSSRectInputGUI::getTop ( )

Get Top.

Returns
string Top

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

References $top.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilCSSRectInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

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

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

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

+ Here is the call graph for this function:

◆ setBottom()

ilCSSRectInputGUI::setBottom (   $a_value)

Set Bottom.

Parameters
string$a_valueBottom

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

99 {
100 $this->bottom = $a_value;
101 }

◆ setLeft()

ilCSSRectInputGUI::setLeft (   $a_value)

Set Left.

Parameters
string$a_valueLeft

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

119 {
120 $this->left = $a_value;
121 }

◆ setRight()

ilCSSRectInputGUI::setRight (   $a_value)

Set Right.

Parameters
string$a_valueRight

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

139 {
140 $this->right = $a_value;
141 }

◆ setSize()

ilCSSRectInputGUI::setSize (   $a_size)

Set Size.

Parameters
int$a_sizeSize

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

159 {
160 $this->size = $a_size;
161 }

◆ setTop()

ilCSSRectInputGUI::setTop (   $a_value)

Set Top.

Parameters
string$a_valueTop

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

79 {
80 $this->top = $a_value;
81 }

◆ setUseUnits()

ilCSSRectInputGUI::setUseUnits (   $a_value)

Set use units.

Parameters
boolean$a_valueUse units

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

59 {
60 $this->useUnits = $a_value;
61 }

References useUnits().

+ 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 168 of file class.ilCSSRectInputGUI.php.

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

References ilFormPropertyGUI\getPostVar().

+ Here is the call graph for this function:

◆ useUnits()

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

◆ $bottom

ilCSSRectInputGUI::$bottom
protected

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

Referenced by getBottom().

◆ $left

ilCSSRectInputGUI::$left
protected

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

Referenced by getLeft().

◆ $right

ilCSSRectInputGUI::$right
protected

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

Referenced by getRight().

◆ $size

ilCSSRectInputGUI::$size
protected

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

Referenced by getSize().

◆ $top

ilCSSRectInputGUI::$top
protected

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

Referenced by getTop().

◆ $useUnits

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: