本文整理汇总了PHP中ilDateTimeInputGUI::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP ilDateTimeInputGUI::setRequired方法的具体用法?PHP ilDateTimeInputGUI::setRequired怎么用?PHP ilDateTimeInputGUI::setRequired使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilDateTimeInputGUI
的用法示例。
在下文中一共展示了ilDateTimeInputGUI::setRequired方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initAddCodesForm
function initAddCodesForm()
{
global $ilCtrl, $lng;
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($ilCtrl->getFormAction($this, 'createCodes'));
$this->form_gui->setTitle($lng->txt('user_account_codes_edit_header'));
$count = new ilNumberInputGUI($lng->txt('user_account_codes_number'), 'acc_codes_number');
$count->setSize(4);
$count->setMaxLength(4);
$count->setMinValue(1);
$count->setMaxValue(1000);
$count->setRequired(true);
$this->form_gui->addItem($count);
$valid = new ilRadioGroupInputGUI($lng->txt('user_account_code_valid_until'), 'valid_type');
$valid->setRequired(true);
$unl = new ilRadioOption($lng->txt('user_account_code_valid_until_unlimited'), 'valid_unlimited');
$valid->addOption($unl);
$st = new ilRadioOption($lng->txt('user_account_code_valid_until_static'), 'valid_static');
$valid->addOption($st);
$dt = new ilDateTimeInputGUI($lng->txt('date'), 'valid_date');
$dt->setRequired(true);
$st->addSubItem($dt);
$dyn = new ilRadioOption($lng->txt('user_account_code_valid_until_dynamic'), 'valid_dynamic');
$valid->addOption($dyn);
$ds = new ilNumberInputGUI($lng->txt('days'), 'valid_days');
$ds->setSize(5);
$ds->setRequired(true);
$dyn->addSubItem($ds);
$this->form_gui->addItem($valid);
$this->form_gui->addCommandButton('createCodes', $lng->txt('create'));
$this->form_gui->addCommandButton('listCodes', $lng->txt('cancel'));
}
示例2: initAccessRestrictionForm
protected function initAccessRestrictionForm($a_from_search = false)
{
$user_ids = $this->getActionUserIds();
if (!$user_ids) {
ilUtil::sendFailure($this->lng->txt('select_one'));
return $this->viewObject();
}
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt("time_limit_add_time_limit_for_selected"));
$form->setFormAction($this->ctrl->getFormAction($this, "confirmaccessRestrict"));
$from = new ilDateTimeInputGUI($this->lng->txt("access_from"), "from");
$from->setShowTime(true);
$from->setRequired(true);
$form->addItem($from);
$to = new ilDateTimeInputGUI($this->lng->txt("access_until"), "to");
$to->setRequired(true);
$to->setShowTime(true);
$form->addItem($to);
$form->addCommandButton("confirmaccessRestrict", $this->lng->txt("confirm"));
$form->addCommandButton("view", $this->lng->txt("cancel"));
foreach ($user_ids as $user_id) {
$ufield = new ilHiddenInputGUI("id[]");
$ufield->setValue($user_id);
$form->addItem($ufield);
}
// return to search?
if ($a_from_search || $_POST["frsrch"]) {
$field = new ilHiddenInputGUI("frsrch");
$field->setValue(1);
$form->addItem($field);
}
return $form;
}
示例3: initPropertiesForm
/**
* Init survey settings form
*
* @return ilPropertyFormGUI
*/
function initPropertiesForm()
{
$template_settings = $hide_rte_switch = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template);
$template_settings = $template->getSettings();
$hide_rte_switch = $template_settings["rte_switch"]["hide"];
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("survey_properties");
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("settings"));
$form->addItem($header);
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->object->getId(), 0, "svy");
$md_section = $md_obj->getGeneral();
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setRequired(true);
$title->setValue($md_section->getTitle());
$form->addItem($title);
$ids = $md_section->getDescriptionIds();
if ($ids) {
$desc_obj = $md_section->getDescription(array_pop($ids));
$desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
$desc->setCols(50);
$desc->setRows(4);
$desc->setValue($desc_obj->getDescription());
$form->addItem($desc);
}
// pool usage
$pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool");
$opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1);
$opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info"));
$pool_usage->addOption($opt);
$opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0);
$opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info"));
$pool_usage->addOption($opt);
$pool_usage->setValue($this->object->getPoolUsage());
$form->addItem($pool_usage);
// 360°: appraisees
if ($this->object->get360Mode()) {
$self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
$self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info"));
$self_eval->setChecked($this->object->get360SelfEvaluation());
$form->addItem($self_eval);
$self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate");
$self_rate->setInfo($this->lng->txt("survey_360_self_raters_info"));
$self_rate->setChecked($this->object->get360SelfRaters());
$form->addItem($self_rate);
$self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
$self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info"));
$self_appr->setChecked($this->object->get360SelfAppraisee());
$form->addItem($self_appr);
}
// activation
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('rep_activation_availability'));
$form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
$act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
$online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info);
$online->setChecked($this->object->isOnline());
$form->addItem($online);
$act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
// $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
$act_type->setChecked($this->object->isActivationLimited());
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
$dur->setShowTime(true);
$date = $this->object->getActivationStartDate();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->object->getActivationEndDate();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$act_type->addSubItem($dur);
$visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
$visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
$visible->setChecked($this->object->getActivationVisibility());
$act_type->addSubItem($visible);
//.........这里部分代码省略.........
示例4: initAssignmentForm
public function initAssignmentForm($a_mode = "create")
{
global $lng, $ilCtrl, $ilSetting;
// init form
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$this->form->setTitle($a_mode == "edit" ? $this->txt("edit_assignment") : $this->txt("new_assignment"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
// title
$title = new ilTextInputGUI($this->txt("title"), "title");
$title->setMaxLength(200);
$title->setRequired(true);
$this->form->addItem($title);
// start time y/n
$check_start_time = new ilCheckboxInputGUI($this->txt("start_time"), "start_time_cb");
$this->form->addItem($check_start_time);
// start time
$start_time = new ilDateTimeInputGUI("", "start_time");
$start_time->setShowTime(true);
$check_start_time->addSubItem($start_time);
// Deadline
$deadline = new ilDateTimeInputGUI($this->txt("deadline"), "deadline");
$deadline->setShowTime(true);
$deadline->setRequired(true);
$this->form->addItem($deadline);
// mandatory
$mandatory = new ilCheckboxInputGUI($this->txt("mandatory"), "mandatory");
$mandatory->setInfo($this->txt("mandatory_info"));
$mandatory->setChecked(true);
$this->form->addItem($mandatory);
// Work Instructions
$instruction = new ilTextAreaInputGUI($this->txt("instruction"), "instruction");
$instruction->setCols(39);
$instruction->setRows(4);
$instruction->setRequired(true);
$this->form->addItem($instruction);
// files
if ($a_mode == "create") {
$files = new ilFileWizardInputGUI($this->txt('files'), 'files');
$files->setFilenames(array(0 => ''));
$this->form->addItem($files);
$this->form->addCommandButton("saveAssignment", $lng->txt("save"));
$this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
} else {
$this->form->addCommandButton("updateAssignment", $lng->txt("save"));
$this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
}
}
示例5: initDateForm
function initDateForm()
{
global $lng, $ilCtrl;
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt('blog_edit_date'));
$date = new ilDateTimeInputGUI($lng->txt("date"), "date");
$date->setRequired(true);
$date->setShowTime(true);
$date->setInfo($lng->txt('blog_edit_date_info'));
$form->addItem($date);
$date->setDate($this->getPageObject()->getCreated());
$form->addCommandButton('updateDate', $lng->txt('save'));
$form->addCommandButton('preview', $lng->txt('cancel'));
return $form;
}
示例6: initCreateForm
public function initCreateForm($item)
{
global $ilUser;
$settings = ilAdobeConnectServer::_getInstance();
//Login User - this creates a user if he not exists.
if ($settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) {
$this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php');
$ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId());
$ilAdobeConnectUser->loginUser();
}
$this->pluginObj->includeClass('class.ilObjAdobeConnect.php');
if (isset($_POST['tpl_id']) && (int) $_POST['tpl_id'] > 0) {
$item['id'] = $_POST['tpl_id'];
}
$template_settings = array();
if ($item['id']) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($item['id']);
$template_settings = $template->getSettings();
}
$form = new ilPropertyFormGUI();
$form->setTitle($this->pluginObj->txt($item['title']));
// login to ac-server
$this->pluginObj->includeClass('class.ilAdobeConnectServer.php');
// title
$title = new ilTextInputGUI($this->pluginObj->txt("title"), "title");
$title->setRequired(true);
// description
$description = new ilTextAreaInputGUI($this->pluginObj->txt("description"), "desc");
// contact_info_val
$civ = array();
if ($ilUser->getPref('public_profile') == "y") {
if ($ilUser->getPref('public_title')) {
$civ_title = $ilUser->getUTitle() . ' ';
}
$civ[] = $civ_title . $ilUser->getFirstname() . ' ' . $ilUser->getLastname();
if ($ilUser->getPref('public_email')) {
$civ[] = $ilUser->getEmail();
}
if ($ilUser->getPref('public_phone_office') && strlen($ilUser->getPhoneOffice()) > 1) {
$civ[] = $this->pluginObj->txt('office') . ': ' . $ilUser->getPhoneOffice();
}
if ($ilUser->getPref('public_phone_mobile') && strlen($ilUser->getPhoneMobile()) > 1) {
$civ[] = $this->pluginObj->txt('mobile') . ': ' . $ilUser->getPhoneMobile();
}
}
$contact_info_value = implode(', ', $civ);
// owner
$owner = new ilTextInputGUI($this->lng->txt("owner"), "owner");
$owner->setInfo($this->pluginObj->txt('owner_info'));
$owner->setValue(ilObjUser::_lookupLogin($ilUser->getId()));
$radio_time_type = new ilRadioGroupInputGUI($this->pluginObj->txt('time_type_selection'), 'time_type_selection');
// option: permanent room
if (ilAdobeConnectServer::getSetting('enable_perm_room', '1')) {
$permanent_room = new ilRadioOption($this->pluginObj->txt('permanent_room'), 'permanent_room');
$permanent_room->setInfo($this->pluginObj->txt('permanent_room_info'));
$radio_time_type->addOption($permanent_room);
$radio_time_type->setValue('permanent_room');
}
// option: date selection
$opt_date = new ilRadioOption($this->pluginObj->txt('start_date'), 'date_selection');
if ($template_settings['start_date']['hide'] == '0') {
// start date
$sd = new ilDateTimeInputGUI($this->pluginObj->txt("start_date"), "start_date");
$serverConfig = ilAdobeConnectServer::_getInstance();
$now = strtotime('+3 minutes');
$minTime = new ilDateTime($now + $serverConfig->getScheduleLeadTime() * 60 * 60, IL_CAL_UNIX);
$sd->setDate($minTime);
$sd->setShowTime(true);
$sd->setRequired(true);
$opt_date->addSubItem($sd);
}
if ($template_settings['duration']['hide'] == '0') {
$duration = new ilDurationInputGUI($this->pluginObj->txt("duration"), "duration");
$duration->setRequired(true);
$duration->setHours('2');
$opt_date->addSubItem($duration);
}
$radio_time_type->addOption($opt_date);
$radio_time_type->setRequired(true);
if (!ilAdobeConnectServer::getSetting('enable_perm_room', '1')) {
$radio_time_type->setValue('date_selection');
}
// access-level of the meeting room
$radio_access_level = new ilRadioGroupInputGUI($this->pluginObj->txt('access'), 'access_level');
$opt_private = new ilRadioOption($this->pluginObj->txt('private_room'), ilObjAdobeConnect::ACCESS_LEVEL_PRIVATE);
$opt_protected = new ilRadioOption($this->pluginObj->txt('protected_room'), ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED);
$opt_public = new ilRadioOption($this->pluginObj->txt('public_room'), ilObjAdobeConnect::ACCESS_LEVEL_PUBLIC);
$radio_access_level->addOption($opt_private);
$radio_access_level->addOption($opt_protected);
$radio_access_level->addOption($opt_public);
$radio_access_level->setValue(ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED);
$this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php');
$ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId());
$ilAdobeConnectUser->ensureAccountExistance();
$xavc_login = $ilAdobeConnectUser->getXAVCLogin();
$folder_id = $ilAdobeConnectUser->ensureUserFolderExistance($xavc_login);
if ($template_settings['reuse_existing_rooms']['hide'] == '0') {
$all_scos = (array) ilObjAdobeConnect::getScosByFolderId($folder_id);
$local_scos = (array) ilObjAdobeConnect::getLocalScos();
//.........这里部分代码省略.........
示例7: initAddCodesForm
function initAddCodesForm()
{
global $rbacreview, $ilObjDataCache, $lng;
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes'));
$this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header'));
$count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number');
$count->setSize(4);
$count->setMaxLength(4);
$count->setMinValue(1);
$count->setMaxValue(1000);
$count->setRequired(true);
$this->form_gui->addItem($count);
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($this->lng->txt('registration_codes_roles_title'));
$this->form_gui->addItem($sec);
include_once './Services/AccessControl/classes/class.ilObjRole.php';
$options = array("" => $this->lng->txt('registration_codes_no_assigned_role'));
foreach ($rbacreview->getGlobalRoles() as $role_id) {
if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
$options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
}
}
$roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role");
$roles->setInfo($this->lng->txt("registration_codes_override_info"));
$roles->setOptions($options);
$this->form_gui->addItem($roles);
$local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local");
$local->setMulti(true);
$local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true));
$this->form_gui->addItem($local);
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($this->lng->txt('reg_access_limitations'));
$this->form_gui->addItem($sec);
$limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit");
$limit->setInfo($this->lng->txt("registration_codes_override_info"));
$this->form_gui->addItem($limit);
$opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none");
$limit->addOption($opt);
$opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited");
$limit->addOption($opt);
$opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute");
$limit->addOption($opt);
$dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date");
$dt->setRequired(true);
$opt->addSubItem($dt);
$opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative");
$limit->addOption($opt);
$days = new ilTextInputGUI("", "rel_date[d]");
$days->setSize(5);
$days->setSuffix($this->lng->txt("days"));
$mon = new ilTextInputGUI("", "rel_date[m]");
$mon->setSize(5);
$mon->setSuffix($this->lng->txt("months"));
$yr = new ilTextInputGUI("", "rel_date[y]");
$yr->setSize(5);
$yr->setSuffix($this->lng->txt("years"));
// custom input won't reload
if (is_array($_POST["rel_date"])) {
$days->setValue($_POST["rel_date"]["d"]);
$mon->setValue($_POST["rel_date"]["m"]);
$yr->setValue($_POST["rel_date"]["y"]);
}
$dur = new ilCustomInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target"));
$dur->setRequired(true);
$dur->setHTML($days->getToolbarHTML() . " " . $mon->getToolbarHTML() . " " . $yr->getToolbarHTML());
$opt->addSubItem($dur);
$this->form_gui->addCommandButton('createCodes', $this->lng->txt('create'));
}
示例8: initEditForm
/**
* Init object edit form
*
* @return ilPropertyFormGUI
*/
protected function initEditForm()
{
global $lng, $ilCtrl;
$lng->loadLanguageModule($this->object->getType());
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "update"));
$form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$form->addItem($ti);
$ti = new ilDateTimeInputGUI($this->lng->txt("title"), "datum");
$ti->setInfo("bitte ausfüllen");
$ti->setRequired(false);
$form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setCols(40);
$ta->setRows(2);
$form->addItem($ta);
$this->initEditCustomForm($form);
$form->addCommandButton("update", $this->lng->txt("save"));
//$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
return $form;
}