ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBackgroundImageInputGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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 ()
 
 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
 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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 = "" 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), ilFormPropertyGUI\setType(), and ILIAS\Repository\user().

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  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilBackgroundImageInputGUI::checkInput ( )

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

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

62  : bool
63  {
64  $lng = $this->lng;
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...
+ Here is the call graph for this function:

◆ getImages()

ilBackgroundImageInputGUI::getImages ( )

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

References $images.

Referenced by insert().

57  : array
58  {
59  return $this->images;
60  }
+ Here is the caller graph for this function:

◆ getInput()

ilBackgroundImageInputGUI::getInput ( )

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

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

Referenced by checkInput().

87  : array
88  {
89  return $this->strArray($this->getPostVar());
90  }
+ 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.

References $value.

Referenced by insert().

47  : string
48  {
49  return $this->value;
50  }
+ Here is the caller graph for this function:

◆ insert()

ilBackgroundImageInputGUI::insert ( ilTemplate  $a_tpl)

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

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

92  : void
93  {
94  $tpl = new ilTemplate("tpl.prop_background_image.html", true, true, "Services/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  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static prepareFormOutput($a_str, bool $a_strip=false)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

◆ setImages()

ilBackgroundImageInputGUI::setImages ( array  $a_images)

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

Referenced by ilStyleCharacteristicGUI\initTagStyleForm().

52  : void
53  {
54  $this->images = $a_images;
55  }
+ Here is the caller graph for this function:

◆ setValue()

ilBackgroundImageInputGUI::setValue ( string  $a_value)

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

Referenced by checkInput(), and setValueByArray().

42  : void
43  {
44  $this->value = $a_value;
45  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilBackgroundImageInputGUI::setValueByArray ( array  $a_values)

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

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

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  }
+ 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().


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