本文整理汇总了PHP中ilPropertyFormGUI::setPreventDoubleSubmission方法的典型用法代码示例。如果您正苦于以下问题:PHP ilPropertyFormGUI::setPreventDoubleSubmission方法的具体用法?PHP ilPropertyFormGUI::setPreventDoubleSubmission怎么用?PHP ilPropertyFormGUI::setPreventDoubleSubmission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilPropertyFormGUI
的用法示例。
在下文中一共展示了ilPropertyFormGUI::setPreventDoubleSubmission方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: certificateEditor
/**
* Shows the certificate editor for ILIAS tests
*/
public function certificateEditor()
{
global $ilAccess;
$form_fields = array();
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$form_fields = $this->getFormFieldsFromPOST();
} else {
$form_fields = $this->getFormFieldsFromFO();
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setPreventDoubleSubmission(false);
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("certificate_edit"));
$form->setMultipart(TRUE);
$form->setTableWidth("100%");
$form->setId("certificate");
$active = new ilCheckboxInputGUI($this->lng->txt("active"), "active");
$active->setChecked($form_fields["active"]);
$form->addItem($active);
$import = new ilFileInputGUI($this->lng->txt("import"), "certificate_import");
$import->setRequired(FALSE);
$import->setSuffixes(array("zip"));
// handle the certificate import
if (strlen($_FILES["certificate_import"]["tmp_name"])) {
if ($import->checkInput()) {
$result = $this->object->importCertificate($_FILES["certificate_import"]["tmp_name"], $_FILES["certificate_import"]["name"]);
if ($result == FALSE) {
$import->setAlert($this->lng->txt("certificate_error_import"));
} else {
$this->ctrl->redirect($this, "certificateEditor");
}
}
}
$form->addItem($import);
$pageformat = new ilRadioGroupInputGUI($this->lng->txt("certificate_page_format"), "pageformat");
$pageformats = $this->object->getPageFormats();
$pageformat->setValue($form_fields["pageformat"]);
foreach ($pageformats as $format) {
$option = new ilRadioOption($format["name"], $format["value"]);
if (strcmp($format["value"], "custom") == 0) {
$pageheight = new ilTextInputGUI($this->lng->txt("certificate_pageheight"), "pageheight");
$pageheight->setValue($form_fields["pageheight"]);
$pageheight->setSize(6);
$pageheight->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$pageheight->setInfo($this->lng->txt("certificate_unit_description"));
$pageheight->setRequired(true);
$option->addSubitem($pageheight);
$pagewidth = new ilTextInputGUI($this->lng->txt("certificate_pagewidth"), "pagewidth");
$pagewidth->setValue($form_fields["pagewidth"]);
$pagewidth->setSize(6);
$pagewidth->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$pagewidth->setInfo($this->lng->txt("certificate_unit_description"));
$pagewidth->setRequired(true);
$option->addSubitem($pagewidth);
}
$pageformat->addOption($option);
}
$pageformat->setRequired(true);
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$pageformat->checkInput();
}
$form->addItem($pageformat);
$bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
$bgimage->setRequired(FALSE);
$bgimage->setUseCache(false);
if (count($_POST)) {
// handle the background upload
if (strlen($_FILES["background"]["tmp_name"])) {
if ($bgimage->checkInput()) {
$result = $this->object->uploadBackgroundImage($_FILES["background"]["tmp_name"]);
if ($result == FALSE) {
$bgimage->setAlert($this->lng->txt("certificate_error_upload_bgimage"));
}
}
}
}
if (!$this->object->hasBackgroundImage()) {
include_once "./Services/Certificate/classes/class.ilObjCertificateSettingsAccess.php";
if (ilObjCertificateSettingsAccess::hasBackgroundImage()) {
$bgimage->setImage(ilObjCertificateSettingsAccess::getBackgroundImageThumbPathWeb());
}
} else {
$bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
}
$form->addItem($bgimage);
$padding_top = new ilTextInputGUI($this->lng->txt("certificate_padding_top"), "padding_top");
$padding_top->setRequired(TRUE);
$padding_top->setValue($form_fields["padding_top"]);
$padding_top->setSize(6);
$padding_top->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$padding_top->setInfo($this->lng->txt("certificate_unit_description"));
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$padding_top->checkInput();
}
$form->addItem($padding_top);
$rect = new ilCSSRectInputGUI($this->lng->txt("certificate_margin_body"), "margin_body");
//.........这里部分代码省略.........
示例2: settingsObject
/**
* Set the language settings
*/
function settingsObject()
{
global $ilSetting;
$translate_key = "lang_translate_" . $this->object->key;
// save and get the page translation setting
if (!empty($_POST)) {
$ilSetting->set($translate_key, (bool) $_POST["translation"]);
ilUtil::sendSuccess($this->lng->txt("settings_saved"));
}
$translate = $ilSetting->get($translate_key, false);
require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("language_settings"));
$form->setPreventDoubleSubmission(false);
$form->addCommandButton('settings', $this->lng->txt("language_change_settings"));
$ci = new ilCheckboxInputGUI($this->lng->txt("language_translation_enabled"), "translation");
$ci->setChecked((bool) $translate);
$ci->setInfo($this->lng->txt("language_note_translation"));
$form->addItem($ci);
$this->tpl->setContent($form->getHTML());
}
示例3: showMail
/**
* Detail view of a mail
*/
public function showMail()
{
/**
* @var $ilUser ilObjUser
* @var $ilToolbar ilToolbarGUI
* @var $ilTabs ilTabsGUI
*/
global $ilUser, $ilToolbar, $ilTabs;
if ($_SESSION['mail_id']) {
$_GET['mail_id'] = $_SESSION['mail_id'];
$_SESSION['mail_id'] = '';
}
$ilTabs->clearTargets();
$ilTabs->setBackTarget($this->lng->txt('back_to_folder'), $this->ctrl->getFormAction($this, 'showFolder'));
$this->umail->markRead(array((int) $_GET['mail_id']));
$mailData = $this->umail->getMail((int) $_GET['mail_id']);
$this->tpl->setTitle($this->lng->txt('mail_mails_of'));
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setPreventDoubleSubmission(false);
$form->setTableWidth('100%');
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$form->setFormAction($this->ctrl->getFormAction($this, 'showMail'));
$this->ctrl->clearParameters($this);
$form->setTitle($this->lng->txt('mail_mails_of'));
if ('tree' == ilSession::get(ilMailGUI::VIEWMODE_SESSION_KEY)) {
$this->tpl->setVariable('FORM_TARGET', ilFrameTargetInfo::_getFrame('MainContent'));
}
include_once 'Services/Accessibility/classes/class.ilAccessKeyGUI.php';
/**
* @var $sender ilObjUser
*/
$sender = ilObjectFactory::getInstanceByObjId($mailData['sender_id'], false);
if ($sender && $sender->getId() && $sender->getId() != ANONYMOUS_USER_ID) {
$this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameterByClass('ilmailformgui', 'type', 'reply');
$this->ctrl->clearParametersByClass('iliasmailformgui');
$ilToolbar->addButton($this->lng->txt('reply'), $this->ctrl->getLinkTargetByClass('ilmailformgui'), '', ilAccessKey::REPLY);
$this->ctrl->clearParameters($this);
}
$this->ctrl->setParameterByClass('ilmailformgui', 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameterByClass('ilmailformgui', 'type', 'forward');
$this->ctrl->clearParametersByClass('iliasmailformgui');
$ilToolbar->addButton($this->lng->txt('forward'), $this->ctrl->getLinkTargetByClass('ilmailformgui'), '', ilAccessKey::FORWARD_MAIL);
$this->ctrl->clearParameters($this);
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$ilToolbar->addButton($this->lng->txt('print'), $this->ctrl->getLinkTarget($this, 'printMail'), '_blank');
$this->ctrl->clearParameters($this);
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameter($this, 'selected_cmd', 'deleteMails');
$ilToolbar->addButton($this->lng->txt('delete'), $this->ctrl->getLinkTarget($this), '', ilAccessKey::DELETE);
$this->ctrl->clearParameters($this);
if ($sender && $sender->getId() && $sender->getId() != ANONYMOUS_USER_ID) {
$linked_fullname = $sender->getPublicName();
$picture = ilUtil::img($sender->getPersonalPicturePath('xsmall'), $sender->getPublicName());
$add_to_addb_button = '';
if (in_array(ilObjUser::_lookupPref($sender->getId(), 'public_profile'), array('y', 'g'))) {
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$this->ctrl->setParameter($this, 'user', $sender->getId());
$linked_fullname = '<br /><a href="' . $this->ctrl->getLinkTarget($this, 'showUser') . '" title="' . $linked_fullname . '">' . $linked_fullname . '</a>';
$this->ctrl->clearParameters($this);
}
if ($sender->getId() != $ilUser->getId()) {
require_once 'Services/Contact/classes/class.ilAddressbook.php';
$abook = new ilAddressbook($ilUser->getId());
if ($abook->checkEntryByLogin($sender->getLogin()) == 0) {
$tplbtn = new ilTemplate('tpl.buttons.html', true, true);
$tplbtn->setCurrentBlock('btn_cell');
$this->ctrl->setParameter($this, 'mail_id', (int) $_GET['mail_id']);
$tplbtn->setVariable('BTN_LINK', $this->ctrl->getLinkTarget($this, 'add'));
$this->ctrl->clearParameters($this);
$tplbtn->setVariable('BTN_TXT', $this->lng->txt('mail_add_to_addressbook'));
$tplbtn->parseCurrentBlock();
$add_to_addb_button = '<br />' . $tplbtn->get();
}
}
$from = new ilCustomInputGUI($this->lng->txt('from'));
$from->setHtml($picture . ' ' . $linked_fullname . $add_to_addb_button);
$form->addItem($from);
} else {
if (!$sender || !$sender->getId()) {
$from = new ilCustomInputGUI($this->lng->txt('from'));
$from->setHtml($mailData['import_name'] . ' (' . $this->lng->txt('user_deleted') . ')');
$form->addItem($from);
} else {
$from = new ilCustomInputGUI($this->lng->txt('from'));
$from->setHtml(ilUtil::img(ilUtil::getImagePath('HeaderIconAvatar.svg'), ilMail::_getIliasMailerName()) . '<br />' . ilMail::_getIliasMailerName());
$form->addItem($from);
}
}
$to = new ilCustomInputGUI($this->lng->txt('mail_to'));
$to->setHtml(ilUtil::htmlencodePlainString($this->umail->formatNamesForOutput($mailData['rcp_to']), false));
$form->addItem($to);
if ($mailData['rcp_cc']) {
$cc = new ilCustomInputGUI($this->lng->txt('cc'));
$cc->setHtml(ilUtil::htmlencodePlainString($this->umail->formatNamesForOutput($mailData['rcp_cc']), false));
$form->addItem($cc);
//.........这里部分代码省略.........
示例4: fillRow
/**
* Fill table row
*/
protected function fillRow($d)
{
global $lng, $ilCtrl;
$this->tpl->setVariable("TXT_ASS_TITLE", $d["title"]);
$file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->exc_id, $d["type"], $d["id"], $this->part_id, $this->parent_cmd);
$has_no_team_yet = false;
if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
$members = ilExAssignment::getTeamMembersByAssignmentId($d["id"], $this->part_id);
// #11957
if (sizeof($members)) {
$this->tpl->setCurrentBlock("ass_members");
foreach ($members as $member_id) {
$this->tpl->setVariable("TXT_MEMBER_NAME", ilObjUser::_lookupFullname($member_id));
$this->tpl->parseCurrentBlock();
}
$ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
$this->tpl->setVariable("HREF_LOG", $ilCtrl->getLinkTarget($this->parent_obj, "showTeamLog"));
$this->tpl->setVariable("TXT_LOG", $lng->txt("exc_team_log"));
$ilCtrl->setParameter($this->parent_obj, "lpart", "");
} else {
// #11957
$has_no_team_yet = true;
$this->tpl->setCurrentBlock("team_info");
$this->tpl->setVariable("TXT_TEAM_INFO", $lng->txt("exc_no_team_yet"));
$this->tpl->setVariable("TXT_CREATE_TEAM", $lng->txt("exc_create_team"));
$ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]);
$ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
$this->tpl->setVariable("URL_CREATE_TEAM", $ilCtrl->getLinkTarget($this->getParentObject(), "createSingleMemberTeam"));
$ilCtrl->setParameter($this->parent_obj, "lpart", "");
$ilCtrl->setParameter($this->parent_obj, "ass_id", "");
if ($file_info["files"]["count"]) {
$this->tpl->setVariable("TEAM_FILES_INFO", "<br />" . $file_info["files"]["txt"] . ": " . $file_info["files"]["count"]);
}
$this->tpl->parseCurrentBlock();
}
}
if (!$has_no_team_yet) {
$this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "assid[" . $d["id"] . "]", 1));
$this->tpl->setVariable("VAL_ID", $d["id"]);
$this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
$this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
$this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
$this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
if ($file_info["files"]["download_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
$this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
$this->tpl->parseCurrentBlock();
}
if ($file_info["files"]["download_new_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
$this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
$this->tpl->parseCurrentBlock();
}
// note
$this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
$this->tpl->setVariable("NAME_NOTE", "notice[" . $d["id"] . "]");
$this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($d["id"], $this->part_id)));
// comment for learner
$lcomment_value = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
$overlay_id = "excasscomm_" . $d["id"] . "_" . $this->part_id;
$overlay_trigger_id = $overlay_id . "_tr";
$overlay = new ilOverlayGUI($overlay_id);
$overlay->setAnchor($overlay_trigger_id);
$overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
$overlay->add();
$this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
$this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
$lcomment_form = new ilPropertyFormGUI();
$lcomment_form->setId($overlay_id);
$lcomment_form->setPreventDoubleSubmission(false);
$lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $d["id"] . "_" . $this->part_id);
$lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
$lcomment->setValue($lcomment_value);
$lcomment->setCols(45);
$lcomment->setRows(5);
$lcomment_form->addItem($lcomment);
//$lcomment_form->addCommandButton("save", $lng->txt("save"));
// $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
$this->overlay_tpl->setCurrentBlock("overlay_bl");
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
$this->overlay_tpl->parseCurrentBlock();
/*
$this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("exc_comment_for_learner"));
$this->tpl->setVariable("NAME_LCOMMENT",
"lcomment[".$d["id"]."]");
$lpcomment = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
$this->tpl->setVariable("VAL_LCOMMENT",
ilUtil::prepareFormOutput($lpcomment));
*/
// solved
//$this->tpl->setVariable("CHKBOX_SOLVED",
// ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
//.........这里部分代码省略.........
示例5: initForm
/**
* Init form
*
* @param string $a_cmd
* @return ilPropertyFormGUI
*/
public function initForm($a_cmd = "")
{
global $ilCtrl, $lng;
$lng->loadLanguageModule('crs');
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this->parent_obj, $a_cmd));
$form->setTarget('_blank');
$form->setPreventDoubleSubmission(false);
$form->setTitle($lng->txt('sess_gen_attendance_list'));
$title = new ilTextInputGUI($lng->txt('title'), 'title');
$title->setValue($this->title);
$form->addItem($title);
$desc = new ilTextInputGUI($lng->txt('description'), 'desc');
$desc->setValue($this->description);
$form->addItem($desc);
if (sizeof($this->presets)) {
$preset = new ilCheckboxGroupInputGUI($lng->txt('user_detail'), 'preset');
$preset_value = array();
foreach ($this->presets as $id => $item) {
$preset->addOption(new ilCheckboxOption($item[0], $id));
if ($item[1]) {
$preset_value[] = $id;
}
}
$preset->setValue($preset_value);
$form->addItem($preset);
}
$blank = new ilTextInputGUI($lng->txt('event_blank_columns'), 'blank');
$blank->setMulti(true);
$form->addItem($blank);
if ($this->pre_blanks) {
$blank->setValue($this->pre_blanks);
}
$part = new ilFormSectionHeaderGUI();
$part->setTitle($lng->txt('event_participant_selection'));
$form->addItem($part);
// participants by roles
foreach ($this->role_data as $role_id => $role_data) {
$chk = new ilCheckboxInputGUI($role_data[0], 'role_' . $role_id);
$chk->setValue(1);
$chk->setChecked(1);
$form->addItem($chk);
}
// not in sessions
if ($this->waiting_list) {
$chk = new ilCheckboxInputGUI($lng->txt('group_new_registrations'), 'subscr');
$chk->setValue(1);
$form->addItem($chk);
$chk = new ilCheckboxInputGUI($lng->txt('crs_waiting_list'), 'wlist');
$chk->setValue(1);
$form->addItem($chk);
}
if ($this->user_filters) {
foreach ($this->user_filters as $sub_id => $sub_item) {
$sub = new ilCheckboxInputGUI($sub_item[0], 'members_' . $sub_id);
if ($sub_item[1]) {
$sub->setChecked(true);
}
$form->addItem($sub);
}
}
$form->addCommandButton($a_cmd, $lng->txt('sess_print_attendance_list'));
if ($this->id && $a_cmd) {
include_once "Services/User/classes/class.ilUserFormSettings.php";
$settings = new ilUserFormSettings($this->id);
$settings->deleteValue('desc');
// #11340
$settings->exportToForm($form);
}
return $form;
}
示例6: fillRow
//.........这里部分代码省略.........
$this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
$this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
$this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
if ($file_info["files"]["download_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
$this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
$this->tpl->parseCurrentBlock();
}
if ($file_info["files"]["download_new_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
$this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
$this->tpl->parseCurrentBlock();
}
// note
$this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
$this->tpl->setVariable("NAME_NOTE", "notice[{$member_id}]");
$this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($this->ass_id, $member_id)));
// comment for learner
$lcomment_value = ilExAssignment::lookupCommentForUser($this->ass_id, $member_id);
$overlay_id = "excasscomm_" . $this->ass_id . "_" . $member_id;
$overlay_trigger_id = $overlay_id . "_tr";
$overlay = new ilOverlayGUI($overlay_id);
$overlay->setAnchor($overlay_trigger_id);
$overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
$overlay->add();
$this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
$this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
$lcomment_form = new ilPropertyFormGUI();
$lcomment_form->setId($overlay_id);
$lcomment_form->setPreventDoubleSubmission(false);
$lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $this->ass_id . "_" . $member_id);
$lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
$lcomment->setValue($lcomment_value);
$lcomment->setCols(45);
$lcomment->setRows(10);
$lcomment_form->addItem($lcomment);
$lcomment_form->addCommandButton("save", $lng->txt("save"));
// $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
$this->overlay_tpl->setCurrentBlock("overlay_bl");
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
$this->overlay_tpl->parseCurrentBlock();
// solved
//$this->tpl->setVariable("CHKBOX_SOLVED",
// ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
$status = ilExAssignment::lookupStatusOfUser($this->ass_id, $member_id);
$this->tpl->setVariable("SEL_" . strtoupper($status), ' selected="selected" ');
$this->tpl->setVariable("TXT_NOTGRADED", $lng->txt("exc_notgraded"));
$this->tpl->setVariable("TXT_PASSED", $lng->txt("exc_passed"));
$this->tpl->setVariable("TXT_FAILED", $lng->txt("exc_failed"));
if (($sd = ilExAssignment::lookupStatusTimeOfUser($this->ass_id, $member_id)) > 0) {
$this->tpl->setCurrentBlock("status_date");
$this->tpl->setVariable("TXT_LAST_CHANGE", $lng->txt("last_change"));
$this->tpl->setVariable('VAL_STATUS_DATE', ilDatePresentation::formatDate(new ilDateTime($sd, IL_CAL_DATETIME)));
$this->tpl->parseCurrentBlock();
}
switch ($status) {
case "passed":
$pic = "scorm/passed.svg";
break;
case "failed":
$pic = "scorm/failed.svg";
示例7: getSessionForm
/**
* Returns session form with period set by given $sessions.
* @param array $sessions
* @return ilPropertyFormGUI
*/
public function getSessionForm(array $sessions)
{
/**
* @var $lng ilLanguage
*/
global $lng;
$form = new ilPropertyFormGUI();
$form->setPreventDoubleSubmission(false);
$list = new ilSelectInputGUI($lng->txt('session'), 'session');
$options = array();
foreach ($sessions as $session) {
$start = new ilDateTime($session['connected'], IL_CAL_UNIX);
$end = new ilDateTime($session['disconnected'], IL_CAL_UNIX);
$options[$session['connected'] . ',' . $session['disconnected']] = ilDatePresentation::formatPeriod($start, $end);
}
$list->setOptions($options);
$list->setRequired(true);
$form->addItem($list);
return $form;
}