28 self::NAME_AUTH_PROP_1 =>
'',
29 self::NAME_AUTH_PROP_2 =>
''
37 $response =
new stdClass();
39 $response->{self::NAME_AUTH_PROP_1} = $this->
uuidV4();
40 $response->{self::NAME_AUTH_PROP_2} = $this->uuidV4();
42 echo json_encode($response);
52 return sprintf(
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
54 mt_rand(0, 0xffff), mt_rand(0, 0xffff),
59 mt_rand(0, 0x0fff) | 0x4000,
63 mt_rand(0, 0x3fff) | 0x8000,
65 mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
74 return $this->ctrl_path;
82 $this->ctrl_path = $ctrl_path;
90 $this->values = array(
91 self::NAME_AUTH_PROP_1 => $a_values[$this->getPostVar()][self::NAME_AUTH_PROP_1],
92 self::NAME_AUTH_PROP_2 => $a_values[$this->getPostVar()][self::NAME_AUTH_PROP_2]
95 foreach($this->getSubItems() as $item)
97 $item->setValueByArray($a_values);
104 public function checkInput()
114 $post =
$_POST[$this->getPostVar()];
116 if($this->getRequired() && 2 > count(array_filter(array_map(
'trim', $post))))
118 $this->setAlert(
$lng->txt(
'msg_input_is_required'));
122 return $this->checkSubItemsInput();
131 $a_tpl->
setVariable(
'PROP_GENERIC', $this->render());
138 public function render()
146 $tpl =
new ilTemplate(
'tpl.chatroom_auth_input.html',
true,
true,
'Modules/Chatroom');
148 for($i = 1; $i <= count($this->values); $i++)
150 $const =
'NAME_AUTH_PROP_' . $i;
151 $const_val = constant(
'self::' . $const);
153 $tpl->setVariable(
'TXT_AUTH_PROP_' . $i,
$lng->txt(
'chatroom_auth_' . $const_val));
154 $tpl->setVariable(
'ID_AUTH_PROP_' . $i, $const_val);
155 $tpl->setVariable(
'NAME_AUTH_PROP_' . $i, $const_val);
156 $tpl->setVariable(
'VALUE_AUTH_PROP_' . $i, $this->values[$const_val]);
159 $ilCtrl->setParameterByClass(
'ilformpropertydispatchgui',
'postvar', $this->getPostVar());
160 $tpl->setVariable(
'URL',
$ilCtrl->getLinkTargetByClass($this->ctrl_path,
'getRandomValues',
'',
true,
false));
161 $tpl->setVariable(
'ID_BTN', $this->getFieldId() .
'_btn');
162 $tpl->setVariable(
'TXT_BTN',
$lng->txt(
'chatroom_auth_btn_txt'));
163 $tpl->setVariable(
'POST_VAR', $this->getPostVar());
164 $tpl->setVariable(
'SIZE', $this->getSize());
165 if($this->getDisabled())
167 $tpl->setVariable(
'DISABLED',
' disabled="disabled"');
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
setVariable($variable, $value='')
Sets a variable value.
special template class to simplify handling of ITX/PEAR
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled