本文整理汇总了PHP中ilFormat::dateDB2timestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFormat::dateDB2timestamp方法的具体用法?PHP ilFormat::dateDB2timestamp怎么用?PHP ilFormat::dateDB2timestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilFormat
的用法示例。
在下文中一共展示了ilFormat::dateDB2timestamp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveTestAccessProperties
/**
* @param ilPropertyFormGUI $form
*/
private function saveTestAccessProperties(ilPropertyFormGUI $form)
{
// starting time
if ($this->formPropertyExists($form, 'chb_starting_time') && !$this->testOBJ->participantDataExist()) {
if ($form->getItemByPostVar('chb_starting_time')->getChecked()) {
$this->testOBJ->setStartingTime(ilFormat::dateDB2timestamp($form->getItemByPostVar('starting_time')->getDate()->get(IL_CAL_DATETIME)));
$this->testOBJ->setStartingTimeEnabled(true);
} else {
$this->testOBJ->setStartingTimeEnabled(false);
}
}
// ending time
if ($this->formPropertyExists($form, 'chb_ending_time') && !$this->testOBJ->participantDataExist()) {
if ($form->getItemByPostVar('chb_ending_time')->getChecked()) {
$this->testOBJ->setEndingTime(ilFormat::dateDB2timestamp($form->getItemByPostVar('ending_time')->getDate()->get(IL_CAL_DATETIME)));
$this->testOBJ->setEndingTimeEnabled(true);
} else {
$this->testOBJ->setEndingTimeEnabled(false);
}
}
if ($this->formPropertyExists($form, 'password_enabled')) {
$this->testOBJ->setPasswordEnabled($form->getItemByPostVar('password_enabled')->getChecked());
if ($form->getItemByPostVar('password_enabled')->getChecked()) {
$this->testOBJ->setPassword($form->getItemByPostVar('password')->getValue());
} else {
$this->testOBJ->setPassword('');
// otherwise test will still respect value
}
}
if ($this->formPropertyExists($form, 'fixedparticipants') && !$this->testOBJ->participantDataExist()) {
$this->testOBJ->setFixedParticipants($form->getItemByPostVar('fixedparticipants')->getChecked());
}
if ($this->formPropertyExists($form, 'limitUsers')) {
$this->testOBJ->setLimitUsersEnabled($form->getItemByPostVar('limitUsers')->getChecked());
if ($form->getItemByPostVar('limitUsers')->getChecked()) {
$this->testOBJ->setAllowedUsers($form->getItemByPostVar('allowedUsers')->getValue());
$this->testOBJ->setAllowedUsersTimeGap($form->getItemByPostVar('allowedUsersTimeGap')->getValue());
} else {
$this->testOBJ->setAllowedUsers('');
// otherwise test will still respect value
}
}
}
示例2: performSaveForm
//.........这里部分代码省略.........
$kioskOptions = $form->getItemByPostVar('kiosk_options')->getValue();
if (is_array($kioskOptions)) {
$this->testOBJ->setShowKioskModeTitle(in_array('kiosk_title', $kioskOptions));
$this->testOBJ->setShowKioskModeParticipant(in_array('kiosk_participant', $kioskOptions));
$this->testOBJ->setExamidInKiosk(in_array('examid_in_kiosk', $_POST["kiosk_options"]));
}
}
// redirect after test
if ($form->getItemByPostVar('redirection_enabled')->getChecked()) {
$this->testOBJ->setRedirectionMode($form->getItemByPostVar('redirection_mode')->getValue());
} else {
$this->testOBJ->setRedirectionMode(REDIRECT_NONE);
}
if (strlen($form->getItemByPostVar('redirection_url')->getValue())) {
$this->testOBJ->setRedirectionUrl($form->getItemByPostVar('redirection_url')->getValue());
} else {
$this->testOBJ->setRedirectionUrl(null);
}
if ($form->getItemByPostVar('sign_submission')->getChecked()) {
$this->testOBJ->setSignSubmission(true);
} else {
$this->testOBJ->setSignSubmission(false);
}
$this->testOBJ->setEnableProcessingTime($form->getItemByPostVar('chb_processing_time')->getChecked());
if ($this->testOBJ->getEnableProcessingTime()) {
$processingTime = $form->getItemByPostVar('processing_time');
$this->testOBJ->setProcessingTime(sprintf("%02d:%02d:%02d", $processingTime->getHours(), $processingTime->getMinutes(), $processingTime->getSeconds()));
} else {
$this->testOBJ->setProcessingTime('');
}
$this->testOBJ->setResetProcessingTime($form->getItemByPostVar('chb_reset_processing_time')->getChecked());
if ($form->getItemByPostVar('chb_starting_time')->getChecked()) {
$startingTimeSetting = $form->getItemByPostVar('starting_time');
$this->testOBJ->setStartingTime(ilFormat::dateDB2timestamp($startingTimeSetting->getDate()->get(IL_CAL_DATETIME)));
} else {
$this->testOBJ->setStartingTime('');
}
if ($form->getItemByPostVar('chb_ending_time')->getChecked()) {
$endingTimeSetting = $form->getItemByPostVar('ending_time');
$this->testOBJ->setEndingTime(ilFormat::dateDB2timestamp($endingTimeSetting->getDate()->get(IL_CAL_DATETIME)));
} else {
$this->testOBJ->setEndingTime('');
}
if ($form->getItemByPostVar('forcejs') instanceof ilFormPropertyGUI) {
$this->testOBJ->setForceJS($form->getItemByPostVar('forcejs')->getChecked());
}
if ($form->getItemByPostVar('title_output') instanceof ilFormPropertyGUI) {
$this->testOBJ->setTitleOutput($form->getItemByPostVar('title_output')->getValue());
}
if ($form->getItemByPostVar('password') instanceof ilFormPropertyGUI) {
$this->testOBJ->setPassword($form->getItemByPostVar('password')->getValue());
}
if ($form->getItemByPostVar('allowedUsers') instanceof ilFormPropertyGUI) {
$this->testOBJ->setAllowedUsers($form->getItemByPostVar('allowedUsers')->getValue());
}
if ($form->getItemByPostVar('allowedUsersTimeGap') instanceof ilFormPropertyGUI) {
$this->testOBJ->setAllowedUsersTimeGap($form->getItemByPostVar('allowedUsersTimeGap')->getValue());
}
// Selector for uicode characters
global $ilSetting;
if ($ilSetting->get('char_selector_availability') > 0) {
require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
$char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
$char_selector->addFormProperties($form);
$char_selector->getFormValues($form);
$this->testOBJ->setCharSelectorAvailability($char_selector->getConfig()->getAvailability());
示例3: savePropertiesObject
//.........这里部分代码省略.........
} else {
$this->object->setActivationLimited(false);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$this->object->setIntroduction($_POST["introduction"], false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
$this->object->setShowInfo($_POST["showinfo"] ? 1 : 0);
$this->object->setFinalStatement($_POST["finalstatement"], false, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
$this->object->setShowFinalStatement($_POST["showfinalstatement"] ? 1 : 0);
$this->object->setSequenceSettings($_POST["chb_postpone"] ? 1 : 0);
$this->object->setShuffleQuestions($_POST["chb_shuffle_questions"] ? 1 : 0);
$this->object->setListOfQuestions($_POST["list_of_questions"]);
if (is_array($_POST["list_of_questions_options"])) {
$this->object->setListOfQuestionsStart(in_array('chb_list_of_questions_start', $_POST["list_of_questions_options"]) ? 1 : 0);
$this->object->setListOfQuestionsEnd(in_array('chb_list_of_questions_end', $_POST["list_of_questions_options"]) ? 1 : 0);
$this->object->setListOfQuestionsDescription(in_array('chb_list_of_questions_with_description', $_POST["list_of_questions_options"]) ? 1 : 0);
} else {
$this->object->setListOfQuestionsStart(0);
$this->object->setListOfQuestionsEnd(0);
$this->object->setListOfQuestionsDescription(0);
}
$this->object->setMailNotification($_POST["mailnotification"]);
$this->object->setMailNotificationType($_POST["mailnottype"]);
$this->object->setShowMarker($_POST["chb_show_marker"] ? 1 : 0);
$this->object->setShowCancel($_POST["chb_show_cancel"] ? 1 : 0);
$this->object->setKioskMode($_POST["kiosk"] ? 1 : 0);
$this->object->setShowKioskModeTitle(is_array($_POST["kiosk_options"]) && in_array('kiosk_title', $_POST["kiosk_options"]) ? 1 : 0);
$this->object->setShowKioskModeParticipant(is_array($_POST["kiosk_options"]) && in_array('kiosk_participant', $_POST["kiosk_options"]) ? 1 : 0);
$this->object->setEnableProcessingTime($_POST["chb_processing_time"] ? 1 : 0);
if ($this->object->getEnableProcessingTime()) {
$this->object->setProcessingTime(sprintf("%02d:%02d:%02d", $_POST["processing_time"]["hh"], $_POST["processing_time"]["mm"], $_POST["processing_time"]["ss"]));
} else {
$this->object->setProcessingTime('');
}
$this->object->setResetProcessingTime($_POST["chb_reset_processing_time"] ? 1 : 0);
if ($_POST['chb_starting_time']) {
$this->object->setStartingTime(ilFormat::dateDB2timestamp($_POST['starting_time']['date'] . ' ' . $_POST['starting_time']['time']));
} else {
$this->object->setStartingTime('');
}
if ($_POST['chb_ending_time']) {
$this->object->setEndingTime(ilFormat::dateDB2timestamp($_POST['ending_time']['date'] . ' ' . $_POST['ending_time']['time']));
} else {
$this->object->setEndingTime('');
}
$this->object->setUsePreviousAnswers($_POST["chb_use_previous_answers"] ? 1 : 0);
$this->object->setForceJS($_POST["forcejs"] ? 1 : 0);
$this->object->setTitleOutput($_POST["title_output"]);
$this->object->setPassword($_POST["password"]);
$this->object->setAllowedUsers($_POST["allowedUsers"]);
$this->object->setAllowedUsersTimeGap($_POST["allowedUsersTimeGap"]);
$this->object->setAutosave($_POST['autosave']);
$this->object->setAutosaveIval($_POST['autosave_ival']);
if ($this->object->isRandomTest()) {
$this->object->setUsePreviousAnswers(0);
}
$invited_users = $this->object->getInvitedUsers();
if (!($total && count($invited_users) == 0)) {
$fixed_participants = 0;
if (array_key_exists("fixedparticipants", $_POST)) {
if ($_POST["fixedparticipants"]) {
$fixed_participants = 1;
}
}
$this->object->setFixedParticipants($fixed_participants);
if (!$fixed_participants) {
$invited_users = $this->object->getInvitedUsers();
foreach ($invited_users as $user_object) {
$this->object->disinviteUser($user_object["usr_id"]);
}
}
}
$this->object->setHighscoreEnabled((bool) $_POST['highscore_enabled']);
$this->object->setHighscoreAnon((bool) $_POST['highscore_anon']);
$this->object->setHighscoreAchievedTS((bool) $_POST['highscore_achieved_ts']);
$this->object->setHighscoreScore((bool) $_POST['highscore_score']);
$this->object->setHighscorePercentage((bool) $_POST['highscore_percentage']);
$this->object->setHighscoreHints((bool) $_POST['highscore_hints']);
$this->object->setHighscoreWTime((bool) $_POST['highscore_wtime']);
$this->object->setHighscoreOwnTable((bool) $_POST['highscore_own_table']);
$this->object->setHighscoreTopTable((bool) $_POST['highscore_top_table']);
$this->object->setHighscoreTopNum((int) $_POST['highscore_top_num']);
//$this->object->setExpressModeQuestionPoolAllowed($_POST['express_allow_question_pool']);
$this->object->setEnabledViewMode($_POST['enabled_view_mode']);
$this->object->setPoolUsage($_POST['use_pool']);
$this->object->saveToDb(true);
// Update ecs export settings
include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
$ecs = new ilECSTestSettings($this->object);
$ecs->handleSettingsUpdate();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
if ($randomtest_switch) {
if ($this->object->isRandomTest()) {
$this->object->removeNonRandomTestData();
} else {
$this->object->removeRandomTestData();
}
}
$this->ctrl->redirect($this, 'properties');
}
}