ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (string $a_title="", string $a_postvar="")
 
 setValue (string $a_value)
 
 getValue ()
 
 setImages (array $a_images)
 
 getImages ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
 setValueByArray (array $a_values)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $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...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Protected Attributes

array $images
 
ilObjUser $user
 
string $value
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Detailed Description

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

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilFormPropertyGUI.

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

33 {
34 global $DIC;
35
36 $this->lng = $DIC->language();
37 $this->user = $DIC->user();
38 parent::__construct($a_title, $a_postvar);
39 $this->setType("background_image");
40 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), ilFormPropertyGUI\setType(), and ILIAS\Repository\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.

Reimplemented from ilFormPropertyGUI.

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

62 : bool
63 {
65
66 $input = $this->getInput();
67
68 $type = $input["type"] ?? "";
69 $int_value = $input["int_value"] ?? "";
70 $ext_value = $input["ext_value"] ?? "";
71
72 if ($this->getRequired() && $type == "ext" && trim($ext_value) == "") {
73 $this->setAlert($lng->txt("msg_input_is_required"));
74
75 return false;
76 }
77
78 if ($type == "external") {
79 $this->setValue($ext_value);
80 } else {
81 $this->setValue($int_value);
82 }
83
84 return true;
85 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References ilFormPropertyGUI\$lng, ilFormPropertyGUI\$type, getInput(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), setValue(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getImages()

ilBackgroundImageInputGUI::getImages ( )

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

57 : array
58 {
59 return $this->images;
60 }

References $images.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getInput()

ilBackgroundImageInputGUI::getInput ( )

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

87 : array
88 {
89 return $this->strArray($this->getPostVar());
90 }

References ilFormPropertyGUI\getPostVar(), and ilFormPropertyGUI\strArray().

Referenced by checkInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValue()

ilBackgroundImageInputGUI::getValue ( )

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

47 : string
48 {
49 return $this->value;
50 }

References $value.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilBackgroundImageInputGUI::insert ( ilTemplate  $a_tpl)

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

92 : void
93 {
94 $tpl = new ilTemplate("tpl.prop_background_image.html", true, true, "components/ILIAS/Style/Content");
95
96 $tpl->setVariable("POSTVAR", $this->getPostVar());
97
98 $int_options = array_merge(array("" => ""), $this->getImages());
99
100 $value = trim($this->getValue());
101
102 if (is_int(strpos($value, "/"))) {
103 $current_type = "ext";
104 $tpl->setVariable("EXTERNAL_SELECTED", 'checked="checked"');
105 $tpl->setVariable("VAL_EXT", ilLegacyFormElementsUtil::prepareFormOutput($value));
106 } else {
107 $current_type = "int";
108 $tpl->setVariable("INTERNAL_SELECTED", 'checked="checked"');
109 }
110
111 foreach ($int_options as $option) {
112 $tpl->setCurrentBlock("int_option");
113 $tpl->setVariable("VAL_INT", $option);
114 $tpl->setVariable("TXT_INT", $option);
115
116 if ($current_type == "int" && $value == $option) {
117 $tpl->setVariable("INT_SELECTED", 'selected="selected"');
118 }
119 $tpl->parseCurrentBlock();
120 }
121
122 $a_tpl->setCurrentBlock("prop_generic");
123 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
124 $a_tpl->parseCurrentBlock();
125 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
static prepareFormOutput($a_str, bool $a_strip=false)
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)

References $value, getImages(), ilFormPropertyGUI\getPostVar(), getValue(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ setImages()

ilBackgroundImageInputGUI::setImages ( array  $a_images)

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

52 : void
53 {
54 $this->images = $a_images;
55 }

◆ setValue()

ilBackgroundImageInputGUI::setValue ( string  $a_value)

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

42 : void
43 {
44 $this->value = $a_value;
45 }

Referenced by checkInput(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilBackgroundImageInputGUI::setValueByArray ( array  $a_values)

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

127 : void
128 {
129 if ($a_values[$this->getPostVar()]["type"] == "internal") {
130 $this->setValue($a_values[$this->getPostVar()]["int_value"]);
131 } else {
132 $this->setValue($a_values[$this->getPostVar()]["ext_value"]);
133 }
134 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $images

array ilBackgroundImageInputGUI::$images
protected

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

Referenced by getImages().

◆ $user

ilObjUser ilBackgroundImageInputGUI::$user
protected

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

◆ $value

string ilBackgroundImageInputGUI::$value
protected

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

Referenced by getValue(), and insert().


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