本文整理匯總了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);
}