ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilManualPlaceholderInputGUI Class Reference

Class ilManualPlaceholderInputGUI. More...

+ Inheritance diagram for ilManualPlaceholderInputGUI:
+ Collaboration diagram for ilManualPlaceholderInputGUI:

Public Member Functions

 __construct (string $label, string $dependencyElementId)
 
 getRerenderUrl ()
 
 getRerenderTriggerElementName ()
 
 supportsRerenderSignal (string $elementId, string $url)
 
 getAdviseText ()
 
 setAdviseText (string $adviseText)
 
 getInstructionText ()
 
 setInstructionText (string $instructionText)
 
 addPlaceholder (string $placeholder, string $title)
 
 insert (ilTemplate $a_tpl)
 
 render (bool $ajax=false)
 
 setValueByArray (array $a_values)
 
 setValue ($a_value)
 
 checkInput ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 
- 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

GlobalHttpState $httpState
 
array $placeholders = []
 
string $rerenderUrl = ''
 
string $rerenderTriggerElementName = ''
 
string $dependencyElementId
 
string $instructionText = ''
 
string $adviseText = ''
 
ilGlobalTemplateInterface $tpl
 
 $value
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- 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

Constructor & Destructor Documentation

◆ __construct()

ilManualPlaceholderInputGUI::__construct ( string  $label,
string  $dependencyElementId 
)

Definition at line 44 of file class.ilManualPlaceholderInputGUI.php.

References $dependencyElementId, $DIC, and ILIAS\GlobalScreen\Provider\__construct().

45  {
46  global $DIC;
47 
48  $this->tpl = $DIC->ui()->mainTemplate();
49  $this->httpState = $DIC->http();
50 
51  $this->dependencyElementId = $dependencyElementId;
52 
53  parent::__construct($label);
54 
55  $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
56  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addPlaceholder()

ilManualPlaceholderInputGUI::addPlaceholder ( string  $placeholder,
string  $title 
)

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

References ilFormPropertyGUI\$title.

Referenced by ilObjMailGUI\getExternalSettingsForm().

94  : void
95  {
96  $this->placeholders[$placeholder]['placeholder'] = $placeholder;
97  $this->placeholders[$placeholder]['title'] = $title;
98  }
+ Here is the caller graph for this function:

◆ checkInput()

ilManualPlaceholderInputGUI::checkInput ( )

Definition at line 169 of file class.ilManualPlaceholderInputGUI.php.

169  : bool
170  {
171  return true;
172  }

◆ getAdviseText()

ilManualPlaceholderInputGUI::getAdviseText ( )

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

References $adviseText.

Referenced by render().

74  : string
75  {
76  return $this->adviseText;
77  }
+ Here is the caller graph for this function:

◆ getInstructionText()

ilManualPlaceholderInputGUI::getInstructionText ( )

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

References $instructionText.

84  : string
85  {
87  }

◆ getRerenderTriggerElementName()

ilManualPlaceholderInputGUI::getRerenderTriggerElementName ( )

Definition at line 63 of file class.ilManualPlaceholderInputGUI.php.

References $rerenderTriggerElementName.

Referenced by render().

63  : string
64  {
66  }
+ Here is the caller graph for this function:

◆ getRerenderUrl()

ilManualPlaceholderInputGUI::getRerenderUrl ( )

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

References $rerenderUrl.

Referenced by render().

58  : ?string
59  {
60  return $this->rerenderUrl;
61  }
+ Here is the caller graph for this function:

◆ insert()

ilManualPlaceholderInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 100 of file class.ilManualPlaceholderInputGUI.php.

References ilTemplate\parseCurrentBlock(), render(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

100  : void
101  {
102  $html = $this->render();
103 
104  $a_tpl->setCurrentBlock('prop_generic');
105  $a_tpl->setVariable('PROP_GENERIC', $html);
106  $a_tpl->parseCurrentBlock();
107  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ render()

ilManualPlaceholderInputGUI::render ( bool  $ajax = false)

Definition at line 109 of file class.ilManualPlaceholderInputGUI.php.

References getAdviseText(), getRerenderTriggerElementName(), getRerenderUrl(), and ILIAS\Repository\lng().

Referenced by insert().

109  : string
110  {
111  $subtpl = new ilTemplate(
112  'tpl.mail_manual_placeholders.html',
113  true,
114  true,
115  'Services/Mail'
116  );
117  $subtpl->setVariable('TXT_USE_PLACEHOLDERS', $this->lng->txt('mail_nacc_use_placeholder'));
118  $subtpl->setVariable('DEPENDENCY_ELM_ID_OUTER', $this->dependencyElementId);
119  if ($this->getAdviseText()) {
120  $subtpl->setVariable('TXT_PLACEHOLDERS_ADVISE', $this->getAdviseText());
121  }
122 
123  if (count($this->placeholders) > 0) {
124  foreach ($this->placeholders as $placeholder) {
125  $subtpl->setCurrentBlock('man_placeholder');
126  $subtpl->setVariable('DEPENDENCY_ELM_ID', $this->dependencyElementId);
127  $subtpl->setVariable('PLACEHOLDER', '[' . $placeholder['placeholder'] . ']');
128  $subtpl->setVariable('PLACEHOLDER_INTERACTION_INFO', sprintf(
129  $this->lng->txt('mail_hint_add_placeholder_x'),
130  '[' . $placeholder['placeholder'] . ']'
131  ));
132  $subtpl->setVariable('PLACEHOLDER_DESCRIPTION', $placeholder['title']);
133  $subtpl->parseCurrentBlock();
134  }
135  }
136 
137  if ($this->getRerenderTriggerElementName() && $this->getRerenderUrl()) {
138  $subtpl->setVariable('RERENDER_URL', $this->getRerenderUrl());
139  $subtpl->setVariable('RERENDER_TRIGGER_ELM_NAME', $this->getRerenderTriggerElementName());
140  }
141 
142  if ($ajax) {
143  $this->httpState->saveResponse(
144  $this->httpState
145  ->response()
146  ->withBody(Streams::ofString($subtpl->get()))
147  );
148  $this->httpState->sendResponse();
149  $this->httpState->close();
150  }
151 
152  return $subtpl->get();
153  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAdviseText()

ilManualPlaceholderInputGUI::setAdviseText ( string  $adviseText)

Definition at line 79 of file class.ilManualPlaceholderInputGUI.php.

References $adviseText.

79  : void
80  {
81  $this->adviseText = $adviseText;
82  }

◆ setInstructionText()

ilManualPlaceholderInputGUI::setInstructionText ( string  $instructionText)

Definition at line 89 of file class.ilManualPlaceholderInputGUI.php.

References $instructionText.

Referenced by ilMailTemplateGUI\getAjaxPlaceholdersById(), and ilMailFormGUI\showForm().

89  : void
90  {
91  $this->instructionText = $instructionText;
92  }
+ Here is the caller graph for this function:

◆ setValue()

ilManualPlaceholderInputGUI::setValue (   $a_value)

Definition at line 160 of file class.ilManualPlaceholderInputGUI.php.

References ilFormPropertyGUI\getMulti(), and ilFormPropertyGUI\setMultiValues().

Referenced by setValueByArray().

160  : void
161  {
162  if (is_array($a_value) && $this->getMulti()) {
163  $this->setMultiValues($a_value);
164  $a_value = array_shift($a_value);
165  }
166  $this->value = $a_value;
167  }
setMultiValues(array $a_values)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValueByArray()

ilManualPlaceholderInputGUI::setValueByArray ( array  $a_values)

Definition at line 155 of file class.ilManualPlaceholderInputGUI.php.

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

155  : void
156  {
157  $this->setValue($a_values[$this->getPostVar()] ?? null);
158  }
+ Here is the call graph for this function:

◆ supportsRerenderSignal()

ilManualPlaceholderInputGUI::supportsRerenderSignal ( string  $elementId,
string  $url 
)

Definition at line 68 of file class.ilManualPlaceholderInputGUI.php.

References $url.

68  : void
69  {
70  $this->rerenderTriggerElementName = $elementId;
71  $this->rerenderUrl = $url;
72  }
$url

Field Documentation

◆ $adviseText

string ilManualPlaceholderInputGUI::$adviseText = ''
protected

Definition at line 39 of file class.ilManualPlaceholderInputGUI.php.

Referenced by getAdviseText(), and setAdviseText().

◆ $dependencyElementId

string ilManualPlaceholderInputGUI::$dependencyElementId
protected

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

Referenced by __construct().

◆ $httpState

GlobalHttpState ilManualPlaceholderInputGUI::$httpState
protected

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

◆ $instructionText

string ilManualPlaceholderInputGUI::$instructionText = ''
protected

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

Referenced by getInstructionText(), and setInstructionText().

◆ $placeholders

array ilManualPlaceholderInputGUI::$placeholders = []
protected

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

◆ $rerenderTriggerElementName

string ilManualPlaceholderInputGUI::$rerenderTriggerElementName = ''
protected

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

Referenced by getRerenderTriggerElementName().

◆ $rerenderUrl

string ilManualPlaceholderInputGUI::$rerenderUrl = ''
protected

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

Referenced by getRerenderUrl().

◆ $tpl

ilGlobalTemplateInterface ilManualPlaceholderInputGUI::$tpl
protected

Definition at line 40 of file class.ilManualPlaceholderInputGUI.php.

◆ $value

ilManualPlaceholderInputGUI::$value
protected

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


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