本文整理汇总了PHP中ilPropertyFormGUI::checkInput方法的典型用法代码示例。如果您正苦于以下问题:PHP ilPropertyFormGUI::checkInput方法的具体用法?PHP ilPropertyFormGUI::checkInput怎么用?PHP ilPropertyFormGUI::checkInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilPropertyFormGUI
的用法示例。
在下文中一共展示了ilPropertyFormGUI::checkInput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadFiles
/**
* Update properties
*/
public function uploadFiles()
{
$response = new stdClass();
$response->error = null;
$response->debug = null;
$this->initUploadForm();
if ($this->form->checkInput()) {
try {
$fileresult = $this->handleFileUpload($this->form->getInput("upload_files"));
if ($fileresult) {
$response = (object) array_merge((array) $response, (array) $fileresult);
}
} catch (ilException $e) {
$response->error = $e->getMessage();
}
} else {
$error = new ilCloudException(ilCloudException::UPLOAD_FAILED);
$response->error = $error->getMessage();
}
// send response object (don't use 'application/json' as IE wants to download it!)
header('Vary: Accept');
header('Content-type: text/plain');
echo ilJsonUtil::encode($response);
exit;
}
示例2: saveSettings
/**
*
*/
protected function saveSettings()
{
/**
* @var $rbacsystem ilRbacSystem
* @var $ilErr ilErrorHandling
*/
global $rbacsystem, $ilErr;
if (!$rbacsystem->checkAccess('write', $this->object->getRefId())) {
$ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
}
$provider = $this->factory->getByContext(ilTermsOfServiceTableDataProviderFactory::CONTEXT_AGRREMENT_BY_LANGUAGE);
$list = $provider->getList(array(), array());
$has_documents = false;
foreach ($list['items'] as $item) {
if ($item['agreement_document']) {
$has_documents = true;
break;
}
}
$this->initSettingsForm();
if ($this->form->checkInput()) {
if ($has_documents || !(int) $this->form->getInput('tos_status')) {
$this->object->saveStatus((int) $this->form->getInput('tos_status'));
ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
}
}
if (!$has_documents && (int) $this->form->getInput('tos_status') && !$this->object->getStatus()) {
$_POST['tos_status'] = 0;
ilUtil::sendFailure($this->lng->txt('tos_no_documents_exist_cant_save'));
}
$this->settings(false);
}
示例3: checkInput
/**
* Check input of form
*
* @param $a_mode 'create' | 'update'
*
* @return bool
*/
protected function checkInput($a_mode)
{
global $lng;
$return = $this->form->checkInput();
// Additional check for text fields: The length property should be max 200 if the textarea option is not set
if ($this->form->getInput('datatype') == ilDataCollectionDatatype::INPUTFORMAT_TEXT && (int) $this->form->getInput('prop_' . ilDataCollectionField::PROPERTYID_LENGTH) > 200 && !$this->form->getInput('prop_' . ilDataCollectionField::PROPERTYID_TEXTAREA)) {
$inputObj = $this->form->getItemByPostVar('prop_' . ilDataCollectionField::PROPERTYID_LENGTH);
$inputObj->setAlert($lng->txt("form_msg_value_too_high"));
$return = false;
}
// Don't allow multiple fields with the same title in this table
if ($a_mode == 'create') {
if ($title = $this->form->getInput('title')) {
if (ilDataCollectionTable::_hasFieldByTitle($title, $this->table_id)) {
$inputObj = $this->form->getItemByPostVar('title');
$inputObj->setAlert($lng->txt("dcl_field_title_unique"));
$return = false;
}
}
}
if (!$return) {
ilUtil::sendFailure($lng->txt("form_input_not_valid"));
}
return $return;
}
示例4: updateProperties
public function updateProperties()
{
$this->initPropertiesForm();
if ($this->form->checkInput()) {
$this->object->setTitle($this->form->getInput('title'));
$this->object->setDescription($this->form->getInput('desc'));
$this->object->update();
ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
$this->ctrl->redirect($this, 'editProperties');
}
$this->form->setValuesByPost();
$this->tpl->setContent($this->form->getHtml());
}
示例5: saveSettings
/**
*
*/
protected function saveSettings()
{
/**
* @var $rbacsystem ilRbacSystem
* @var $ilErr ilErrorHandling
*/
global $rbacsystem, $ilErr;
if (!$rbacsystem->checkAccess('write', $this->object->getRefId())) {
$ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
}
$this->initSettingsForm();
if ($this->form->checkInput()) {
$this->object->saveStatus((int) $this->form->getInput('tos_status'));
ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
}
$this->settings(false);
}
示例6: updateNotificationSettingsObject
public function updateNotificationSettingsObject()
{
/**
* @var $ilAccess ilAccessHandler
* @var $ilErr ilErr
*/
global $ilAccess, $ilErr;
if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
$ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
}
// instantiate the property form
$this->initNotificationSettingsForm();
// check input
if ($this->notificationSettingsForm->checkInput()) {
if (isset($_POST['notification_type']) && $_POST['notification_type'] == 'all_users') {
// set values and call update
$this->objProperties->setAdminForceNoti(1);
$this->objProperties->setUserToggleNoti((int) $this->notificationSettingsForm->getInput('usr_toggle'));
$this->objProperties->setNotificationType('all_users');
$this->updateUserNotifications(true);
} else {
if ($_POST['notification_type'] == 'per_user') {
$this->objProperties->setNotificationType('per_user');
$this->objProperties->setAdminForceNoti(1);
$this->objProperties->setUserToggleNoti(0);
$this->updateUserNotifications();
} else {
$this->objProperties->setNotificationType('default');
$this->objProperties->setAdminForceNoti(0);
$this->objProperties->setUserToggleNoti(0);
include_once 'Modules/Forum/classes/class.ilForumNotification.php';
$frm_noti = new ilForumNotification($this->object->getRefId());
$frm_noti->deleteNotificationAllUsers();
}
}
$this->objProperties->update();
// print success message
ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
}
$this->notificationSettingsForm->setValuesByPost();
return $this->showMembersObject();
}
示例7: saveCategory
/**
*
*/
protected function saveCategory()
{
if (!$this->isCRUDContext()) {
$this->{$this->getDefaultCommand()}();
return;
}
$category = $this->getCategoryById((int) $_GET['category_id']);
$this->initUnitCategoryForm($category);
if ($this->unit_cat_form->checkInput()) {
try {
$category->setCategory($this->unit_cat_form->getInput('category_name'));
$this->repository->saveCategory($category);
ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
$this->{$this->getUnitCategoryOverviewCommand()}();
return;
} catch (ilException $e) {
$this->unit_cat_form->getItemByPostVar('category_name')->setAlert($this->lng->txt($e->getMessage()));
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
}
}
$this->unit_cat_form->setValuesByPost();
$this->tpl->setContent($this->unit_cat_form->getHtml());
}
示例8: save
/**
* Save form input
*/
public function save()
{
/** @var ilCtrl $ilCtrl */
global $tpl, $ilCtrl;
$this->initConfigurationForm();
if ($this->form->checkInput()) {
// Save Checkbox Values
foreach ($this->checkboxes as $key => $cb) {
if (!is_array($cb)) {
$this->setValue($cb, $this->form->getInput($cb));
} else {
$this->setValue($key, $this->form->getInput($key));
foreach ($cb as $field => $gui) {
$this->setValue($key . '_' . $field, $this->form->getInput($key . '_' . $field));
}
}
}
$ilCtrl->redirect($this, 'configure');
} else {
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}
示例9: updateSettings
/**
* Command for saving the updated Test Overview settings.
*
* This command saves the HTML form input into the Test Overview
* currently selected.
*/
protected function updateSettings()
{
/**
* @var $tpl ilTemplate
* @var $lng ilLanguage
* @var $ilCtrl ilCtrl
*/
global $tpl, $lng, $ilCtrl;
$this->initSettingsForm();
if ($this->form->checkInput()) {
/* Form is sent and input validated,
now save settings. */
$this->object->setTitle($this->form->getInput('title'));
$this->object->setDescription($this->form->getInput('desc'));
$this->object->update();
ilUtil::sendSuccess($lng->txt('msg_obj_modified'), true);
/* Back to editSettings */
$ilCtrl->redirect($this, 'editSettings');
}
/* Form is sent but there is an input error.
Fill back the form and render again. */
$this->form->setValuesByPost();
$tpl->setContent($this->renderSettings());
}
示例10: feedback
/**
* Creates the output of the feedback page for a single choice question
*
* @access public
*/
function feedback($checkonly = false)
{
$save = strcmp($this->ctrl->getCmd(), "saveFeedback") == 0 ? TRUE : FALSE;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('feedback_answers'));
$form->setTableWidth("98%");
$form->setId("feedback");
$complete = new ilTextAreaInputGUI($this->lng->txt("feedback_complete_solution"), "feedback_complete");
$complete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(1)));
$complete->setRequired(false);
$complete->setRows(10);
$complete->setCols(80);
if (!$this->getPreventRteUsage()) {
$complete->setUseRte(true);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$complete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$complete->addPlugin("latex");
$complete->addButton("latex");
$complete->addButton("pastelatex");
$complete->setRTESupport($this->object->getId(), "qpl", "assessment", null, false, '3.4.7');
$form->addItem($complete);
$incomplete = new ilTextAreaInputGUI($this->lng->txt("feedback_incomplete_solution"), "feedback_incomplete");
$incomplete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(0)));
$incomplete->setRequired(false);
$incomplete->setRows(10);
$incomplete->setCols(80);
if (!$this->getPreventRteUsage()) {
$incomplete->setUseRte(true);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$incomplete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$incomplete->addPlugin("latex");
$incomplete->addButton("latex");
$incomplete->addButton("pastelatex");
$incomplete->setRTESupport($this->object->getId(), "qpl", "assessment", null, false, '3.4.7');
$form->addItem($incomplete);
if (!$this->getSelfAssessmentEditingMode()) {
foreach ($this->object->getErrorData() as $index => $answer) {
$caption = $ordinal = $index + 1;
$caption .= '. <br />"' . $answer->text_wrong . '" => ';
$caption .= '"' . $answer->text_correct . '"';
$caption .= '</i>';
$answerobj = new ilTextAreaInputGUI($this->object->prepareTextareaOutput($caption, true), "feedback_answer_{$index}");
$answerobj->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackSingleAnswer($index)));
$answerobj->setRequired(false);
$answerobj->setRows(10);
$answerobj->setCols(80);
$answerobj->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$answerobj->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$answerobj->addPlugin("latex");
$answerobj->addButton("latex");
$answerobj->addButton("pastelatex");
$answerobj->setRTESupport($this->object->getId(), "qpl", "assessment", null, false, '3.4.7');
$form->addItem($answerobj);
}
}
global $ilAccess;
if ($ilAccess->checkAccess("write", "", $_GET['ref_id']) || $this->getSelfAssessmentEditingMode()) {
$form->addCommandButton("saveFeedback", $this->lng->txt("save"));
}
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
// again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}
示例11: validateForm
/**
* Validate field form
*
* @param ilPropertyFormGUI $form
* @param ilUserDefinedFields $user_field_definitions
* @param array $access
* @param array $a_field_permissions
* @return bool
*/
protected function validateForm($form, $user_field_definitions, array &$access, array $a_field_permissions = null)
{
global $lng;
if ($form->checkInput()) {
$valid = true;
$incoming = (array) $form->getInput("access");
if ($a_field_permissions) {
$perm_map = self::getAccessPermissions();
}
$access = array();
foreach (array_keys($this->getAccessOptions()) as $id) {
$access[$id] = in_array($id, $incoming);
// disabled fields
if ($a_field_permissions && !$a_field_permissions[ilUDFPermissionHelper::ACTION_FIELD_EDIT_ACCESS][$perm_map[$id]]) {
$access[$id] = $this->field_definition[$id];
}
}
if ($access['required'] && !$access['visib_reg']) {
$this->confirm_change = true;
$form->getItemByPostVar("access")->setAlert($lng->txt('udf_required_requires_visib_reg'));
$valid = false;
}
if (!$this->field_id && $user_field_definitions->nameExists($form->getInput("name"))) {
$form->getItemByPostVar("name")->setAlert($lng->txt('udf_name_already_exists'));
$valid = false;
}
if ($form->getInput("field_type") == UDF_TYPE_SELECT && (!$a_field_permissions || $a_field_permissions[ilUDFPermissionHelper::ACTION_FIELD_EDIT_PROPERTY][ilUDFPermissionHelper::SUBACTION_FIELD_PROPERTIES])) {
$user_field_definitions->setFieldValues($form->getInput("selvalue"));
if ($error = $user_field_definitions->validateValues()) {
switch ($error) {
case UDF_DUPLICATE_VALUES:
$form->getItemByPostVar("selvalue")->setAlert($lng->txt('udf_duplicate_entries'));
$valid = false;
break;
}
}
}
if (!$valid) {
ilUtil::sendFailure($lng->txt("form_input_not_valid"));
}
return $valid;
}
return false;
}
示例12: feedback
/**
* Creates the output of the feedback page for a single choice question
*
* @access public
*/
function feedback($checkonly = false)
{
$save = strcmp($this->ctrl->getCmd(), "saveFeedback") == 0 ? TRUE : FALSE;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('feedback_answers'));
$form->setTableWidth("100%");
$form->setId("feedback");
$complete = new ilTextAreaInputGUI($this->lng->txt("feedback_complete_solution"), "feedback_complete");
$complete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(1)));
$complete->setRequired(falsse);
$complete->setRows(10);
$complete->setCols(80);
$complete->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$complete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$complete->addPlugin("latex");
$complete->addButton("latex");
$complete->addButton("pastelatex");
$complete->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($complete);
$incomplete = new ilTextAreaInputGUI($this->lng->txt("feedback_incomplete_solution"), "feedback_incomplete");
$incomplete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(0)));
$incomplete->setRequired(false);
$incomplete->setRows(10);
$incomplete->setCols(80);
$incomplete->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$incomplete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$incomplete->addPlugin("latex");
$incomplete->addButton("latex");
$incomplete->addButton("pastelatex");
$incomplete->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($incomplete);
if (!$this->getSelfAssessmentEditingMode()) {
foreach ($this->object->answers as $index => $answer) {
$answerobj = new ilTextAreaInputGUI($this->object->prepareTextareaOutput($answer->getAnswertext(), true), "feedback_answer_{$index}");
$answerobj->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackSyntaxTree($index)));
$answerobj->setRequired(false);
$answerobj->setRows(10);
$answerobj->setCols(80);
$answerobj->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$answerobj->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$answerobj->addPlugin("latex");
$answerobj->addButton("latex");
$answerobj->addButton("pastelatex");
$answerobj->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($answerobj);
}
}
$form->addCommandButton("saveFeedback", $this->lng->txt("save"));
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
// again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}
示例13: randomQuestionsObject
function randomQuestionsObject()
{
global $ilUser;
$total = $this->object->evalTotalPersons();
$save = strcmp($this->ctrl->getCmd(), "saveRandomQuestions") == 0 ? TRUE : FALSE;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'randomQuestions'));
$form->setTitle($this->lng->txt('random_selection'));
$form->setDescription($this->lng->txt('tst_select_random_questions'));
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("randomSelectionForm");
// question selection
$selection_mode = $save ? $_POST['chbQuestionSelectionMode'] : $ilUser->getPref("tst_question_selection_mode_equal");
$question_selection = new ilCheckboxInputGUI($this->lng->txt("tst_question_selection"), "chbQuestionSelectionMode");
$question_selection->setValue(1);
$question_selection->setChecked($selection_mode);
$question_selection->setOptionTitle($this->lng->txt('tst_question_selection_equal'));
$question_selection->setInfo($this->lng->txt('tst_question_selection_description'));
$question_selection->setRequired(false);
$form->addItem($question_selection);
// total amount of questions
$total_questions = new ilNumberInputGUI($this->lng->txt('tst_total_questions'), 'total_questions');
$total_questions->setValue($this->object->getRandomQuestionCount());
$total_questions->setSize(3);
$total_questions->setInfo($this->lng->txt('tst_total_questions_description'));
$total_questions->setRequired(false);
$form->addItem($total_questions);
if ($total == 0) {
$found_qpls = $this->object->getRandomQuestionpoolData();
include_once "./Modules/Test/classes/class.ilRandomTestData.php";
if (count($found_qpls) == 0) {
array_push($found_qpls, new ilRandomTestData());
}
$available_qpl =& $this->object->getAvailableQuestionpools(TRUE, $selection_mode, FALSE, TRUE, TRUE);
include_once './Modules/Test/classes/class.ilRandomTestInputGUI.php';
$source = new ilRandomTestInputGUI($this->lng->txt('tst_random_questionpools'), 'source');
$source->setUseEqualPointsOnly($selection_mode);
$source->setRandomQuestionPools($available_qpl);
$source->setUseQuestionCount(array_key_exists('total_questions', $_POST) ? $_POST['total_questions'] < 1 : $this->object->getRandomQuestionCount() < 1);
$source->setValues($found_qpls);
$form->addItem($source);
} else {
$qpls = $this->object->getUsedRandomQuestionpools();
include_once './Modules/Test/classes/class.ilRandomTestROInputGUI.php';
$source = new ilRandomTestROInputGUI($this->lng->txt('tst_random_questionpools'), 'source');
$source->setValues($qpls);
$form->addItem($source);
}
if ($total == 0) {
$form->addCommandButton("saveRandomQuestions", $this->lng->txt("save"));
}
$errors = false;
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
if (!$errors) {
// check total amount of questions
if ($_POST['total_questions'] > 0) {
$totalcount = 0;
foreach ($_POST['source']['qpl'] as $idx => $qpl) {
$totalcount += $available_qpl[$qpl]['count'];
}
if ($_POST['total_questions'] > $totalcount) {
$total_questions->setAlert($this->lng->txt('msg_total_questions_too_high'));
$errors = true;
}
}
}
if ($errors) {
$checkonly = false;
}
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}
示例14: scoringObject
//.........这里部分代码省略.........
if (strlen($this->object->getReportingDate())) {
$reporting_date->setDate(new ilDateTime($this->object->getReportingDate(), IL_CAL_TIMESTAMP));
} else {
$reporting_date->setDate(new ilDateTime(time(), IL_CAL_UNIX));
}
$results_access_date_limitation->addSubItem($reporting_date);
$form->addItem($results_access);
$results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt("tst_results_print_best_solution"), "print_bs_with_res");
$results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info'));
$results_print_best_solution->setValue(1);
$results_print_best_solution->setChecked((bool) $this->object->isBestSolutionPrintedWithResult());
$form->addItem($results_print_best_solution);
// results presentation
$results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt("tst_results_presentation"), "results_presentation");
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_pass_details"), 'pass_details', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_details"), 'solution_details', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_printview"), 'solution_printview', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_compare"), 'solution_compare', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_feedback"), 'solution_feedback', ''));
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_answers_only"), 'solution_answers_only', ''));
$signatureOption = new ilCheckboxOption($this->lng->txt("tst_show_solution_signature"), 'solution_signature', '');
$results_presentation->addOption($signatureOption);
$results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_suggested"), 'solution_suggested', ''));
$values = array();
if ($this->object->getShowPassDetails()) {
array_push($values, 'pass_details');
}
if ($this->object->getShowSolutionDetails()) {
array_push($values, 'solution_details');
}
if ($this->object->getShowSolutionPrintview()) {
array_push($values, 'solution_printview');
}
if ($this->object->getShowSolutionFeedback()) {
array_push($values, 'solution_feedback');
}
if ($this->object->getShowSolutionAnswersOnly()) {
array_push($values, 'solution_answers_only');
}
if ($this->object->getShowSolutionSignature()) {
array_push($values, 'solution_signature');
}
if ($this->object->getShowSolutionSuggested()) {
array_push($values, 'solution_suggested');
}
if ($this->object->getShowSolutionListComparison()) {
array_push($values, 'solution_compare');
}
$results_presentation->setValue($values);
$results_presentation->setInfo($this->lng->txt("tst_results_presentation_description"));
if ($this->object->getAnonymity()) {
$signatureOption->setDisabled(true);
}
$form->addItem($results_presentation);
// misc properties
$header_misc = new ilFormSectionHeaderGUI();
$header_misc->setTitle($this->lng->txt("misc"));
$form->addItem($header_misc);
// deletion of test results
$passDeletion = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_deletion"), "pass_deletion_allowed");
$passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_not_allowed"), 0, ''));
$passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_allowed"), 1, ''));
$passDeletion->setValue($this->object->isPassDeletionAllowed());
$form->addItem($passDeletion);
// export settings
$export_settings = new ilCheckboxGroupInputGUI($this->lng->txt("tst_export_settings"), "export_settings");
$export_settings->addOption(new ilCheckboxOption($this->lng->txt("tst_exp_sc_short"), 'exp_sc_short', ''));
$values = array();
if ($this->object->getExportSettingsSingleChoiceShort()) {
array_push($values, 'exp_sc_short');
}
$export_settings->setValue($values);
$form->addItem($export_settings);
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total == 0) {
$form->addCommandButton("saveScoring", $this->lng->txt("save"));
}
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total != 0) {
$form->addCommandButton("confirmScoring", $this->lng->txt("save"));
}
// remove items when using template
if ($template_settings) {
foreach ($template_settings as $id => $item) {
if ($item["hide"]) {
$form->removeItemByPostVar($id);
}
}
}
$errors = false;
if ($save) {
$errors = !$form->checkInput();
$form->setValuesByPost();
if ($errors) {
$checkonly = false;
}
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}
示例15: propertiesObject
/**
* Questionpool properties
*/
public function propertiesObject()
{
$save = strcmp($this->ctrl->getCmd(), "save") == 0 ? true : false;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
$form->setTitle($this->lng->txt("properties"));
$form->setMultipart(false);
$form->setId("properties");
// online
$online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
$online->setInfo($this->lng->txt("spl_online_property_description"));
$online->setChecked($this->object->getOnline());
$form->addItem($online);
$form->addCommandButton("saveProperties", $this->lng->txt("save"));
if ($save) {
$form->checkInput();
}
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}