ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilManualPlaceholderInputGUI Class Reference

Class ilManualPlaceholderInputGUI. More...

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

Public Member Functions

 __construct (string $label, string $http_post_param_name, protected 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 $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
 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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

44  {
45  global $DIC;
46 
47  $this->tpl = $DIC->ui()->mainTemplate();
48  $this->httpState = $DIC->http();
49 
50  parent::__construct($label, $http_post_param_name);
51 
52  $this->tpl->addJavaScript('assets/js/ilMailComposeFunctions.js');
53  }
global $DIC
Definition: shib_login.php:22
__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 91 of file class.ilManualPlaceholderInputGUI.php.

References ilFormPropertyGUI\$title.

91  : void
92  {
93  $this->placeholders[$placeholder]['placeholder'] = $placeholder;
94  $this->placeholders[$placeholder]['title'] = $title;
95  }

◆ checkInput()

ilManualPlaceholderInputGUI::checkInput ( )

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

165  : bool
166  {
167  return true;
168  }

◆ getAdviseText()

ilManualPlaceholderInputGUI::getAdviseText ( )

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

References $adviseText.

Referenced by render().

71  : string
72  {
73  return $this->adviseText;
74  }
+ Here is the caller graph for this function:

◆ getInstructionText()

ilManualPlaceholderInputGUI::getInstructionText ( )

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

References $instructionText.

81  : string
82  {
84  }

◆ getRerenderTriggerElementName()

ilManualPlaceholderInputGUI::getRerenderTriggerElementName ( )

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

References $rerenderTriggerElementName.

Referenced by render().

60  : string
61  {
63  }
+ Here is the caller graph for this function:

◆ getRerenderUrl()

ilManualPlaceholderInputGUI::getRerenderUrl ( )

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

References $rerenderUrl.

Referenced by render().

55  : ?string
56  {
57  return $this->rerenderUrl;
58  }
+ Here is the caller graph for this function:

◆ insert()

ilManualPlaceholderInputGUI::insert ( ilTemplate  $a_tpl)

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

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

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

◆ render()

ilManualPlaceholderInputGUI::render ( bool  $ajax = false)

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

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

Referenced by insert().

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

◆ setAdviseText()

ilManualPlaceholderInputGUI::setAdviseText ( string  $adviseText)

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

References $adviseText.

76  : void
77  {
78  $this->adviseText = $adviseText;
79  }

◆ setInstructionText()

ilManualPlaceholderInputGUI::setInstructionText ( string  $instructionText)

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

References $instructionText.

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

86  : void
87  {
88  $this->instructionText = $instructionText;
89  }
+ Here is the caller graph for this function:

◆ setValue()

ilManualPlaceholderInputGUI::setValue (   $a_value)

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

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

Referenced by setValueByArray().

156  : void
157  {
158  if (is_array($a_value) && $this->getMulti()) {
159  $this->setMultiValues($a_value);
160  $a_value = array_shift($a_value);
161  }
162  $this->value = $a_value;
163  }
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 151 of file class.ilManualPlaceholderInputGUI.php.

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

151  : void
152  {
153  $this->setValue($a_values[$this->getPostVar()] ?? null);
154  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ supportsRerenderSignal()

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

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

References $url.

65  : void
66  {
67  $this->rerenderTriggerElementName = $elementId;
68  $this->rerenderUrl = $url;
69  }
$url
Definition: shib_logout.php:66

Field Documentation

◆ $adviseText

string ilManualPlaceholderInputGUI::$adviseText = ''
protected

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

Referenced by getAdviseText(), and setAdviseText().

◆ $httpState

GlobalHttpState ilManualPlaceholderInputGUI::$httpState
protected

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

◆ $instructionText

string ilManualPlaceholderInputGUI::$instructionText = ''
protected

Definition at line 37 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 39 of file class.ilManualPlaceholderInputGUI.php.

◆ $value

ilManualPlaceholderInputGUI::$value
protected

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


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