本文整理汇总了PHP中ilCheckboxInputGUI::checkInput方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCheckboxInputGUI::checkInput方法的具体用法?PHP ilCheckboxInputGUI::checkInput怎么用?PHP ilCheckboxInputGUI::checkInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilCheckboxInputGUI
的用法示例。
在下文中一共展示了ilCheckboxInputGUI::checkInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkInput
public function checkInput()
{
if ($this->getRequired() && !isset($_POST[$this->getPostVar()])) {
global $lng;
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
return parent::checkInput();
}
示例2: addAdditionalFormElements
/**
* Allows to add additional form fields to the certificate editor form
* This method will be called when the certificate editor form will built
* using the ilPropertyFormGUI class. Additional fields will be added at the
* bottom of the form.
*
* @param object $form An ilPropertyFormGUI instance
* @param array $form_fields An array containing the form values. The array keys are the names of the form fields
*/
public function addAdditionalFormElements(&$form, $form_fields)
{
global $lng;
$short_name = new ilTextInputGUI($lng->txt("certificate_short_name"), "short_name");
$short_name->setRequired(TRUE);
require_once "./Services/Utilities/classes/class.ilStr.php";
$short_name->setValue(strlen($form_fields["short_name"]) ? $form_fields["short_name"] : ilStr::subStr($this->object->getTitle(), 0, 30));
$short_name->setSize(30);
if (strlen($form_fields["short_name"])) {
$short_name->setInfo(str_replace("[SHORT_TITLE]", $form_fields["short_name"], $lng->txt("certificate_short_name_description")));
} else {
$short_name->setInfo($lng->txt("certificate_short_name_description"));
}
if (count($_POST)) {
$short_name->checkInput();
}
$form->addItem($short_name);
$visibility = new ilCheckboxInputGUI($lng->txt("certificate_enabled_scorm"), "certificate_enabled_scorm");
$visibility->setInfo($lng->txt("certificate_enabled_scorm_introduction"));
$visibility->setValue(1);
if ($form_fields["certificate_enabled_scorm"]) {
$visibility->setChecked(TRUE);
}
if (count($_POST)) {
$visibility->checkInput();
}
$form->addItem($visibility);
}