ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilBackgroundImageInputGUI Class Reference

This class represents a background image property in a property form. More...

+ Inheritance diagram for ilBackgroundImageInputGUI:
+ Collaboration diagram for ilBackgroundImageInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setImages ($a_images)
 Set Images. More...
 
 getImages ()
 Get Images. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
 setValueByArray ($a_values)
 Set value by array. 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

 $user
 
 $value
 
- 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 background image 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.ilBackgroundImageInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

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

47 {
48 global $DIC;
49
50 $this->lng = $DIC->language();
51 $this->user = $DIC->user();
52 parent::__construct($a_title, $a_postvar);
53 $this->setType("background_image");
54 }
user()
Definition: user.php:4
setType($a_type)
Set Type.
global $DIC
Definition: saml.php:7

References $DIC, ilFormPropertyGUI\setType(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilBackgroundImageInputGUI::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 101 of file class.ilBackgroundImageInputGUI.php.

102 {
104
105 $type = $_POST[$this->getPostVar()]["type"] =
106 ilUtil::stripSlashes($_POST[$this->getPostVar()]["type"]);
107 $int_value = $_POST[$this->getPostVar()]["int_value"] =
108 ilUtil::stripSlashes($_POST[$this->getPostVar()]["int_value"]);
109 $ext_value = $_POST[$this->getPostVar()]["ext_value"] =
110 ilUtil::stripSlashes($_POST[$this->getPostVar()]["ext_value"]);
111
112 if ($this->getRequired() && $type == "ext" && trim($ext_value) == "") {
113 $this->setAlert($lng->txt("msg_input_is_required"));
114
115 return false;
116 }
117
118 if ($type == "external") {
119 $this->setValue($ext_value);
120 } else {
121 $this->setValue($int_value);
122 }
123
124 return true;
125 }
$_POST["username"]
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

References $_POST, ilFormPropertyGUI\$lng, ilFormPropertyGUI\$type, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), setValue(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getImages()

ilBackgroundImageInputGUI::getImages ( )

Get Images.

Returns
array Images

Definition at line 91 of file class.ilBackgroundImageInputGUI.php.

92 {
93 return $this->images;
94 }

Referenced by insert().

+ Here is the caller graph for this function:

◆ getValue()

ilBackgroundImageInputGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 71 of file class.ilBackgroundImageInputGUI.php.

References $value.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilBackgroundImageInputGUI::insert ( $a_tpl)

Insert property html.

Definition at line 130 of file class.ilBackgroundImageInputGUI.php.

131 {
132 $tpl = new ilTemplate("tpl.prop_background_image.html", true, true, "Services/Style/Content");
133
134 $tpl->setVariable("POSTVAR", $this->getPostVar());
135
136 $int_options = array_merge(array("" => ""), $this->getImages());
137
138 $value = trim($this->getValue());
139
140 if (is_int(strpos($value, "/"))) {
141 $current_type = "ext";
142 $tpl->setVariable("EXTERNAL_SELECTED", 'checked="checked"');
143 $tpl->setVariable("VAL_EXT", ilUtil::prepareFormOutput($value));
144 } else {
145 $current_type = "int";
146 $tpl->setVariable("INTERNAL_SELECTED", 'checked="checked"');
147 }
148
149 foreach ($int_options as $option) {
150 $tpl->setCurrentBlock("int_option");
151 $tpl->setVariable("VAL_INT", $option);
152 $tpl->setVariable("TXT_INT", $option);
153
154 if ($current_type == "int" && $value == $option) {
155 $tpl->setVariable("INT_SELECTED", 'selected="selected"');
156 }
157 $tpl->parseCurrentBlock();
158 }
159
160 $a_tpl->setCurrentBlock("prop_generic");
161 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
162 $a_tpl->parseCurrentBlock();
163 }
$tpl
Definition: ilias.php:10
special template class to simplify handling of ITX/PEAR
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References $tpl, $value, getImages(), ilFormPropertyGUI\getPostVar(), getValue(), and ilUtil\prepareFormOutput().

+ Here is the call graph for this function:

◆ setImages()

ilBackgroundImageInputGUI::setImages (   $a_images)

Set Images.

Parameters
array$a_imagesImages

Definition at line 81 of file class.ilBackgroundImageInputGUI.php.

82 {
83 $this->images = $a_images;
84 }

◆ setValue()

ilBackgroundImageInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

62 {
63 $this->value = $a_value;
64 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilBackgroundImageInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 170 of file class.ilBackgroundImageInputGUI.php.

171 {
173
174 if ($a_values[$this->getPostVar()]["type"] == "internal") {
175 $this->setValue($a_values[$this->getPostVar()]["int_value"]);
176 } else {
177 $this->setValue($a_values[$this->getPostVar()]["ext_value"]);
178 }
179 }
$ilUser
Definition: imgupload.php:18

References $ilUser, $user, ilFormPropertyGUI\getPostVar(), and setValue().

+ Here is the call graph for this function:

Field Documentation

◆ $user

ilBackgroundImageInputGUI::$user
protected

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

Referenced by setValueByArray().

◆ $value

ilBackgroundImageInputGUI::$value
protected

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

Referenced by getValue(), and insert().


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