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
209 throw new InvalidArgumentException(
210 sprintf(
"Please pass a value of type 'boolean' to specify whether the form is not to be validated when it is submitted")
237 if(!in_array(
$form_target, self::getValidFormTargets()))
239 throw new InvalidArgumentException(
241 "Invalid form target passed, must be one of these: %s",
242 implode(
', ', self::getValidFormTargets())
267 if(!in_array(
$form_method, self::getValidFormMethods()))
269 throw new InvalidArgumentException(
271 "Invalid form method passed, must be one of these: %s",
272 implode(
', ', self::getValidFormMethods())
299 throw new InvalidArgumentException(
301 "Invalid form enc type passed, must be one of these: %s",
302 implode(
', ', self::getValidFormEncTypes())
330 throw new InvalidArgumentException(
331 sprintf(
"The form action must be of type 'string'")
359 if(!is_string(
$form))
361 throw new InvalidArgumentException(
362 sprintf(
"The form id must be of type 'string'")
388 throw new InvalidArgumentException(
389 sprintf(
"The initial value of the button must be of type 'string'")
414 if(!is_string(
$name))
416 throw new InvalidArgumentException(
417 sprintf(
"The name of the button must be of type 'string'")
421 $this->name = $is_command ?
'cmd[' .
$name .
']' :
$name;
440 if(!in_array(
$button_type, self::getValidButtonTypes()))
442 throw new InvalidArgumentException(
444 "Invalid button type passed, must be one of these: %s",
445 implode(
', ', self::getValidButtonTypes())
464 $attr[
'name'] = $this->
getName();
466 $attr[
'form'] = $this->
getForm();
474 $attr[
'rel'] =
'noopener';