19 declare(strict_types=1);
34 self::NAME_AUTH_PROP_1 =>
'',
35 self::NAME_AUTH_PROP_2 =>
'' 38 protected \ILIAS\HTTP\Services
$http;
43 protected array
$values = self::DEFAULT_SHAPE;
65 $this->
http->saveResponse(
66 $this->
http->response()
67 ->withBody($responseStream)
68 ->withHeader(ResponseHeader::CONTENT_TYPE,
'application/json')
70 $this->
http->sendResponse();
77 '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
79 random_int(0, 0xffff),
80 random_int(0, 0xffff),
82 random_int(0, 0xffff),
85 random_int(0, 0x0fff) | 0x4000,
89 random_int(0, 0x3fff) | 0x8000,
91 random_int(0, 0xffff),
92 random_int(0, 0xffff),
108 self::NAME_AUTH_PROP_1 => $a_values[$this->
getPostVar()][self::NAME_AUTH_PROP_1] ??
'',
109 self::NAME_AUTH_PROP_2 => $a_values[$this->
getPostVar()][self::NAME_AUTH_PROP_2]??
'' 113 $item->setValueByArray($a_values);
121 if ($this->
getRequired() && 2 > count(array_filter(array_map(
'trim',
$post)))) {
122 $this->
setAlert($this->
lng->txt(
'msg_input_is_required'));
134 $input = self::DEFAULT_SHAPE;
136 $as_sanizited_string = $this->
refinery->custom()->transformation(
function (
string $value):
string {
140 $null_to_empty_string = $this->
refinery->custom()->transformation(
static function ($value):
string {
141 if ($value === null) {
145 throw new ilException(
'Expected null in transformation');
148 $sanizite_as_string = $this->
refinery->in()->series([
150 $this->refinery->kindlyTo()->string(),
151 $null_to_empty_string
157 $input = $this->
http->wrapper()->post()->retrieve(
159 $this->
refinery->kindlyTo()->recordOf([
160 self::NAME_AUTH_PROP_1 => $sanizite_as_string,
161 self::NAME_AUTH_PROP_2 => $sanizite_as_string
180 $tpl =
new ilTemplate(
'tpl.chatroom_auth_input.html',
true,
true,
'Modules/Chatroom');
182 for (
$i = 1, $iMax = count($this->values);
$i <= $iMax;
$i++) {
183 $const =
'NAME_AUTH_PROP_' .
$i;
184 $const_val = constant(
'self::' . $const);
186 $tpl->setVariable(
'TXT_AUTH_PROP_' .
$i, $DIC->language()->txt(
'chatroom_auth_' . $const_val));
187 $tpl->setVariable(
'ID_AUTH_PROP_' .
$i, $const_val);
188 $tpl->setVariable(
'NAME_AUTH_PROP_' .
$i, $const_val);
189 $tpl->setVariable(
'VALUE_AUTH_PROP_' .
$i, $this->values[$const_val]);
193 for (
$i = 1, $iMax = count($this->values);
$i <= $iMax;
$i++) {
194 $const =
'NAME_AUTH_PROP_' .
$i;
195 $const_val = constant(
'self::' . $const);
197 $tpl->setVariable(
'ID_AUTH_PROP_' .
$i .
'_BTN', $const_val);
200 $DIC->ctrl()->setParameterByClass(
'ilformpropertydispatchgui',
'postvar', $this->
getPostVar());
203 $DIC->ctrl()->getLinkTargetByClass($this->ctrl_path,
'getRandomValues',
'',
true)
206 $tpl->setVariable(
'TXT_BTN', $DIC->language()->txt(
'chatroom_auth_btn_txt'));
213 $tpl->setVariable(
'DISABLED',
' disabled="disabled"');
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl