ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilManualPlaceholderInputGUI Class Reference
+ Inheritance diagram for ilManualPlaceholderInputGUI:
+ Collaboration diagram for ilManualPlaceholderInputGUI:

Public Member Functions

 __construct (string $label, string $http_post_param_name, protected string $dependency_element_id)
 
 getRerenderUrl ()
 
 getRerenderTriggerElementName ()
 
 supportsRerenderSignal (string $element_id, string $url)
 
 getAdviseText ()
 
 setAdviseText (string $advise_text)
 
 getInstructionText ()
 
 setInstructionText (string $instruction_text)
 
 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 $http_state
 
array $placeholders = []
 
string $rerender_url = ''
 
string $rerender_trigger_element_name = ''
 
string $instruction_text = ''
 
string $advise_text = ''
 
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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

40  {
41  global $DIC;
42 
43  $this->tpl = $DIC->ui()->mainTemplate();
44  $this->http_state = $DIC->http();
45 
46  parent::__construct($label, $http_post_param_name);
47 
48  $this->tpl->addJavaScript('assets/js/ilMailComposeFunctions.js');
49  }
global $DIC
Definition: shib_login.php:26
__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 87 of file class.ilManualPlaceholderInputGUI.php.

References ilFormPropertyGUI\$title.

87  : void
88  {
89  $this->placeholders[$placeholder]['placeholder'] = $placeholder;
90  $this->placeholders[$placeholder]['title'] = $title;
91  }

◆ checkInput()

ilManualPlaceholderInputGUI::checkInput ( )

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

161  : bool
162  {
163  return true;
164  }

◆ getAdviseText()

ilManualPlaceholderInputGUI::getAdviseText ( )

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

References $advise_text.

Referenced by render().

67  : string
68  {
69  return $this->advise_text;
70  }
+ Here is the caller graph for this function:

◆ getInstructionText()

ilManualPlaceholderInputGUI::getInstructionText ( )

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

References $instruction_text.

77  : string
78  {
80  }

◆ getRerenderTriggerElementName()

ilManualPlaceholderInputGUI::getRerenderTriggerElementName ( )

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

References $rerender_trigger_element_name.

Referenced by render().

56  : string
57  {
59  }
+ Here is the caller graph for this function:

◆ getRerenderUrl()

ilManualPlaceholderInputGUI::getRerenderUrl ( )

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

References $rerender_url.

Referenced by render().

51  : ?string
52  {
53  return $this->rerender_url;
54  }
+ Here is the caller graph for this function:

◆ insert()

ilManualPlaceholderInputGUI::insert ( ilTemplate  $a_tpl)

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

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

93  : void
94  {
95  $html = $this->render();
96 
97  $a_tpl->setCurrentBlock('prop_generic');
98  $a_tpl->setVariable('PROP_GENERIC', $html);
99  $a_tpl->parseCurrentBlock();
100  }
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 102 of file class.ilManualPlaceholderInputGUI.php.

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

Referenced by insert().

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

◆ setAdviseText()

ilManualPlaceholderInputGUI::setAdviseText ( string  $advise_text)

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

References $advise_text.

72  : void
73  {
74  $this->advise_text = $advise_text;
75  }

◆ setInstructionText()

ilManualPlaceholderInputGUI::setInstructionText ( string  $instruction_text)

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

References $instruction_text.

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

82  : void
83  {
84  $this->instruction_text = $instruction_text;
85  }
+ Here is the caller graph for this function:

◆ setValue()

ilManualPlaceholderInputGUI::setValue (   $a_value)

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

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

Referenced by setValueByArray().

152  : void
153  {
154  if (is_array($a_value) && $this->getMulti()) {
155  $this->setMultiValues($a_value);
156  $a_value = array_shift($a_value);
157  }
158  $this->value = $a_value;
159  }
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 147 of file class.ilManualPlaceholderInputGUI.php.

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

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

◆ supportsRerenderSignal()

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

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

References $url.

61  : void
62  {
63  $this->rerender_trigger_element_name = $element_id;
64  $this->rerender_url = $url;
65  }
$url
Definition: shib_logout.php:68

Field Documentation

◆ $advise_text

string ilManualPlaceholderInputGUI::$advise_text = ''
protected

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

Referenced by getAdviseText(), and setAdviseText().

◆ $http_state

GlobalHttpState ilManualPlaceholderInputGUI::$http_state
protected

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

◆ $instruction_text

string ilManualPlaceholderInputGUI::$instruction_text = ''
protected

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

Referenced by getInstructionText(), and setInstructionText().

◆ $placeholders

array ilManualPlaceholderInputGUI::$placeholders = []
protected

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

◆ $rerender_trigger_element_name

string ilManualPlaceholderInputGUI::$rerender_trigger_element_name = ''
protected

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

Referenced by getRerenderTriggerElementName().

◆ $rerender_url

string ilManualPlaceholderInputGUI::$rerender_url = ''
protected

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

Referenced by getRerenderUrl().

◆ $tpl

ilGlobalTemplateInterface ilManualPlaceholderInputGUI::$tpl
protected

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

◆ $value

ilManualPlaceholderInputGUI::$value
protected

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


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