19 declare(strict_types=1);
34 self::NAME_AUTH_PROP_1 =>
'',
35 self::NAME_AUTH_PROP_2 =>
'' 41 protected array
$values = self::DEFAULT_SHAPE;
62 $this->
http->saveResponse(
63 $this->
http->response()
64 ->withBody($responseStream)
65 ->withHeader(ResponseHeader::CONTENT_TYPE,
'application/json')
67 $this->
http->sendResponse();
74 '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
76 random_int(0, 0xffff),
77 random_int(0, 0xffff),
79 random_int(0, 0xffff),
82 random_int(0, 0x0fff) | 0x4000,
86 random_int(0, 0x3fff) | 0x8000,
88 random_int(0, 0xffff),
89 random_int(0, 0xffff),
105 self::NAME_AUTH_PROP_1 => $a_values[$this->
getPostVar()][self::NAME_AUTH_PROP_1] ??
'',
106 self::NAME_AUTH_PROP_2 => $a_values[$this->
getPostVar()][self::NAME_AUTH_PROP_2] ??
'' 110 $item->setValueByArray($a_values);
119 $this->
setAlert($this->
lng->txt(
'msg_input_is_required'));
131 $input = self::DEFAULT_SHAPE;
133 $as_sanizited_string = $this->
refinery->custom()->transformation(
function (
string $value):
string {
137 $null_to_empty_string = $this->
refinery->custom()->transformation(
static function ($value):
string {
138 if ($value ===
null) {
142 throw new ilException(
'Expected null in transformation');
145 $sanizite_as_string = $this->
refinery->in()->series([
147 $this->refinery->kindlyTo()->string(),
148 $null_to_empty_string
154 $input = $this->
http->wrapper()->post()->retrieve(
156 $this->
refinery->kindlyTo()->recordOf([
157 self::NAME_AUTH_PROP_1 => $sanizite_as_string,
158 self::NAME_AUTH_PROP_2 => $sanizite_as_string
177 $tpl =
new ilTemplate(
'tpl.chatroom_auth_input.html',
true,
true,
'components/ILIAS/Chatroom');
179 for ($i = 1, $iMax = count($this->values); $i <= $iMax; $i++) {
180 $const =
'NAME_AUTH_PROP_' . $i;
181 $const_val = constant(
'self::' . $const);
183 $tpl->setVariable(
'TXT_AUTH_PROP_' . $i, $DIC->language()->txt(
'chatroom_auth_' . $const_val));
184 $tpl->setVariable(
'ID_AUTH_PROP_' . $i, $const_val);
185 $tpl->setVariable(
'NAME_AUTH_PROP_' . $i, $const_val);
186 $tpl->setVariable(
'VALUE_AUTH_PROP_' . $i, $this->values[$const_val]);
190 for ($i = 1, $iMax = count($this->values); $i <= $iMax; $i++) {
191 $const =
'NAME_AUTH_PROP_' . $i;
192 $const_val = constant(
'self::' . $const);
194 $tpl->setVariable(
'ID_AUTH_PROP_' . $i .
'_BTN', $const_val);
197 $DIC->ctrl()->setParameterByClass(
'ilformpropertydispatchgui',
'postvar', $this->
getPostVar());
200 $DIC->ctrl()->getLinkTargetByClass($this->ctrl_path,
'getRandomValues',
'',
true)
202 $tpl->setVariable(
'ID_BTN', $this->
getFieldId() .
'_btn');
203 $tpl->setVariable(
'TXT_BTN', $DIC->language()->txt(
'chatroom_auth_btn_txt'));
206 $tpl->setVariable(
'POST_VAR', $this->
getPostVar());
207 $tpl->setVariable(
'SIZE', $this->
getSize());
210 $tpl->setVariable(
'DISABLED',
' disabled="disabled"');
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
setVariable($variable, $value='')
Sets a variable value.
static ofString(string $string)
Creates a new stream with an initial value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)