4require_once
'Services/UIComponent/Button/classes/class.ilButtonBase.php';
148 self::FORM_TARGET_BLANK,
149 self::FORM_TARGET_PARENT,
150 self::FORM_TARGET_SELF,
151 self::FORM_TARGET_TOP
161 self::FORM_METHOD_POST,
162 self::FORM_METHOD_GET
172 self::FORM_ENC_TYPE_APPLICATION,
173 self::FORM_ENC_TYPE_MULTI_PART,
174 self::FORM_ENC_TYPE_PLAIN
184 self::BUTTON_TYPE_SUBMIT,
185 self::BUTTON_TYPE_BUTTON,
186 self::BUTTON_TYPE_RESET
208 throw new InvalidArgumentException(
209 sprintf(
"Please pass a value of type 'boolean' to specify whether the form is not to be validated when it is submitted")
236 if (!in_array(
$form_target, self::getValidFormTargets())) {
237 throw new InvalidArgumentException(
239 "Invalid form target passed, must be one of these: %s",
240 implode(
', ', self::getValidFormTargets())
265 if (!in_array(
$form_method, self::getValidFormMethods())) {
266 throw new InvalidArgumentException(
268 "Invalid form method passed, must be one of these: %s",
269 implode(
', ', self::getValidFormMethods())
295 throw new InvalidArgumentException(
297 "Invalid form enc type passed, must be one of these: %s",
298 implode(
', ', self::getValidFormEncTypes())
325 throw new InvalidArgumentException(
326 sprintf(
"The form action must be of type 'string'")
354 if (!is_string(
$form)) {
355 throw new InvalidArgumentException(
356 sprintf(
"The form id must be of type 'string'")
381 throw new InvalidArgumentException(
382 sprintf(
"The initial value of the button must be of type 'string'")
407 if (!is_string(
$name)) {
408 throw new InvalidArgumentException(
409 sprintf(
"The name of the button must be of type 'string'")
413 $this->name = $is_command ?
'cmd[' .
$name .
']' :
$name;
432 if (!in_array(
$button_type, self::getValidButtonTypes())) {
433 throw new InvalidArgumentException(
435 "Invalid button type passed, must be one of these: %s",
436 implode(
', ', self::getValidButtonTypes())
455 $attr[
'name'] = $this->
getName();
457 $attr[
'form'] = $this->
getForm();
465 $attr[
'rel'] =
'noopener';
An exception for terminatinating execution or to throw for unit testing.