本文整理汇总了PHP中ilTextInputGUI::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextInputGUI::setDisabled方法的具体用法?PHP ilTextInputGUI::setDisabled怎么用?PHP ilTextInputGUI::setDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTextInputGUI
的用法示例。
在下文中一共展示了ilTextInputGUI::setDisabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($title, $post_var)
{
global $lng;
parent::__construct($title, $post_var);
$this->title_input = new ilTextInputGUI($this->getTitle(), "display_" . $this->getPostVar());
$this->title_input->setDisabled(true);
$this->title_input->setInfo($lng->txt("dcl_ilias_refere\tnce_info"));
$this->search_input = new ilTextInputGUI($this->getTitle(), "search_" . $this->getPostVar());
$this->search_input->setDisabled(false);
$this->search_input->setInfo($lng->txt('dcl_ilias_reference_info'));
$this->hidden_input = new ilHiddenInputGUI($this->getPostVar());
}
示例2: __construct
/**
* @param string $title
* @param string $post_var
*/
public function __construct($title, $post_var)
{
global $lng, $tpl;
/**
* @var $tpl iltemplate
*/
parent::__construct($title, $post_var);
$tpl->addJavaScript('./Modules/DataCollection/js/ilDclTreeSearch.js');
$this->title_input = new ilTextInputGUI($this->getTitle(), "display_" . $this->getPostVar());
$this->title_input->setDisabled(true);
$this->title_input->setInfo($lng->txt("dcl_ilias_refere\tnce_info"));
$this->title_input->setInlineStyle('width: 98%; display:inline-block;');
$this->search_input = new ilTextInputGUI($this->getTitle(), "search_" . $this->getPostVar());
$this->search_input->setDisabled(false);
$this->search_input->setInfo($lng->txt('dcl_ilias_reference_info'));
$this->search_input->setInlineStyle('width: 98%; margin-top: 5px;');
$this->hidden_input = new ilHiddenInputGUI($this->getPostVar());
$this->lng = $lng;
}
示例3: initFormRoleTemplate
/**
* Init create form
* @param bool creation mode
* @return ilPropertyFormGUI $form
*/
protected function initFormRoleTemplate($a_mode = self::FORM_MODE_CREATE)
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
if ($this->creation_mode) {
$this->ctrl->setParameter($this, "new_type", 'rolt');
}
$form->setFormAction($this->ctrl->getFormAction($this));
if ($a_mode == self::FORM_MODE_CREATE) {
$form->setTitle($this->lng->txt('rolt_new'));
$form->addCommandButton('save', $this->lng->txt('rolt_new'));
} else {
$form->setTitle($this->lng->txt('rolt_edit'));
$form->addCommandButton('update', $this->lng->txt('save'));
}
$form->addCommandButton('cancel', $this->lng->txt('cancel'));
$title = new ilTextInputGUI($this->lng->txt('title'), 'title');
if ($a_mode != self::FORM_MODE_CREATE) {
if ($this->object->isInternalTemplate()) {
$title->setDisabled(true);
}
$title->setValue($this->object->getTitle());
}
$title->setSize(40);
$title->setMaxLength(70);
$title->setRequired(true);
$form->addItem($title);
$desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
if ($a_mode != self::FORM_MODE_CREATE) {
$desc->setValue($this->object->getDescription());
}
$desc->setCols(40);
$desc->setRows(3);
$form->addItem($desc);
if ($a_mode != self::FORM_MODE_CREATE) {
$ilias_id = new ilNonEditableValueGUI($this->lng->txt("ilias_id"), "ilias_id");
$ilias_id->setValue('il_' . IL_INST_ID . '_' . ilObject::_lookupType($this->object->getId()) . '_' . $this->object->getId());
$form->addItem($ilias_id);
}
$pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'protected');
$pro->setChecked($GLOBALS['rbacreview']->isProtected($this->rolf_ref_id, $this->object->getId()));
$pro->setValue(1);
$form->addItem($pro);
return $form;
}
示例4: initSettingsTemplateForm
/**
* Init settings template form.
*
* @param int $a_mode Edit Mode
*/
public function initSettingsTemplateForm($a_mode = "edit")
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setMaxLength(200);
$ti->setRequired(true);
// begin-patch lok
if ($this->settings_template->getAutoGenerated()) {
$ti->setDisabled(true);
}
// end-patch lok
$this->form->addItem($ti);
// description
$ti = new ilTextAreaInputGUI($lng->txt("description"), "description");
// begin-patch lok
if ($this->settings_template->getAutoGenerated()) {
$ti->setDisabled(true);
}
$this->form->addItem($ti);
// hidable tabs
$tabs = $this->getConfig()->getHidableTabs();
if (is_array($tabs) && count($tabs) > 0) {
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($lng->txt("adm_hide_tabs"));
$this->form->addItem($sec);
foreach ($tabs as $t) {
// hide tab $t?
$cb = new ilCheckboxInputGUI($t["text"], "tab_" . $t["id"]);
$this->form->addItem($cb);
}
}
// settings
$settings = $this->getConfig()->getSettings();
if (is_array($settings) && count($settings) > 0) {
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($lng->txt("adm_predefined_settings"));
$this->form->addItem($sec);
foreach ($settings as $s) {
// setting
$cb = new ilCheckboxInputGUI($s["text"], "set_" . $s["id"]);
$this->form->addItem($cb);
switch ($s["type"]) {
case ilSettingsTemplateConfig::TEXT:
$ti = new ilTextInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
//$ti->setMaxLength();
//$ti->setSize();
$cb->addSubItem($ti);
break;
case ilSettingsTemplateConfig::BOOL:
$cb2 = new ilCheckboxInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
$cb->addSubItem($cb2);
break;
case ilSettingsTemplateConfig::SELECT:
$si = new ilSelectInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
$si->setOptions($s["options"]);
$cb->addSubItem($si);
break;
case ilSettingsTemplateConfig::CHECKBOX:
$chbs = new ilCheckboxGroupInputGUI($lng->txt("adm_value"), "value_" . $s["id"]);
foreach ($s['options'] as $key => $value) {
$chbs->addOption($c = new ilCheckboxInputGUI($value, $key));
$c->setValue($key);
}
$cb->addSubItem($chbs);
break;
}
if ($s['hidable']) {
// hide setting
$cb_hide = new ilCheckboxInputGUI($lng->txt("adm_hide"), "hide_" . $s["id"]);
$cb->addSubItem($cb_hide);
}
}
}
// save and cancel commands
if ($a_mode == "create") {
$this->form->addCommandButton("saveSettingsTemplate", $lng->txt("save"));
$this->form->addCommandButton("listSettingsTemplates", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("adm_add_settings_template"));
} else {
$this->form->addCommandButton("updateSettingsTemplate", $lng->txt("save"));
$this->form->addCommandButton("listSettingsTemplates", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("adm_edit_settings_template"));
}
$this->form->setFormAction($ilCtrl->getFormAction($this));
}
示例5: initSettingsForm
protected function initSettingsForm($a_mode = 'create')
{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTableWidth('600');
if ($a_mode == 'create') {
$this->form_gui->setTitle($this->lng->txt('icla_add'));
} else {
$this->form_gui->setTitle($this->lng->txt('icla_edit'));
}
$this->form_gui->setTitleIcon(ilUtil::getTypeIconPath('icla', 0));
// Title
$text_input = new ilTextInputGUI($this->lng->txt('title'), 'title');
$text_input->setRequired(true);
$this->form_gui->addItem($text_input);
// Description
$text_area = new ilTextAreaInputGUI($this->lng->txt('desc'), 'desc');
$this->form_gui->addItem($text_area);
// Docentselection
$sel = new ilSelectInputGUI($this->lng->txt(ILINC_MEMBER_DOCENT), 'instructoruserid');
$docentlist = $this->object->getDocentList();
$docent_options = array();
$docent_options[0] = $this->lng->txt('please_choose');
foreach ((array) $docentlist as $id => $data) {
$docent_options[$id] = $data['fullname'];
}
$sel->setOptions($docent_options);
$this->form_gui->addItem($sel);
// Open
$rg = new ilRadioGroupInputGUI($this->lng->txt('access'), 'alwaysopen');
$rg->setValue(0);
$ro = new ilRadioOption($this->lng->txt('ilinc_classroom_open'), 1);
$rg->addOption($ro);
$ro = new ilRadioOption($this->lng->txt('ilinc_classroom_closed'), 0);
$rg->addOption($ro);
$this->form_gui->addItem($rg);
// Display akclassvalues
if ($this->ilias->getSetting('ilinc_akclassvalues_active')) {
$text_input = new ilTextInputGUI($this->lng->txt('akclassvalue1'), 'akclassvalue1');
$text_input->setDisabled(true);
$this->form_gui->addItem($text_input);
$text_input = new ilTextInputGUI($this->lng->txt('akclassvalue2'), 'akclassvalue2');
$text_input->setDisabled(true);
$this->form_gui->addItem($text_input);
}
// save and cancel commands
if ($a_mode == 'create') {
$this->ctrl->setParameter($this, 'mode', 'create');
$this->ctrl->setParameter($this, 'new_type', 'icla');
$this->form_gui->addCommandButton('save', $this->lng->txt('icla_add'));
$this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
} else {
$this->ctrl->setParameter($this, 'class_id', $this->object->id);
$this->form_gui->addCommandButton('updateClassroom', $this->lng->txt('save'));
$this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'updateClassroom'));
}
}
示例6: addStandardFieldsToForm
/**
* Add standard fields to form
*/
function addStandardFieldsToForm($a_form, $a_user = NULL, array $custom_fields = NULL)
{
global $ilSetting, $lng, $rbacreview, $ilias;
// custom registration settings
if (self::$mode == self::MODE_REGISTRATION) {
include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
$registration_settings = new ilRegistrationSettings();
self::$user_field["username"]["group"] = "login_data";
self::$user_field["password"]["group"] = "login_data";
self::$user_field["language"]["default"] = $lng->lang_key;
// different position for role
$roles = self::$user_field["roles"];
unset(self::$user_field["roles"]);
self::$user_field["roles"] = $roles;
self::$user_field["roles"]["group"] = "settings";
}
$fields = $this->getStandardFields();
$current_group = "";
$custom_fields_done = false;
foreach ($fields as $f => $p) {
// next group? -> diplay subheader
if ($p["group"] != $current_group && ilUserProfile::userSettingVisible($f)) {
if (is_array($custom_fields) && !$custom_fields_done) {
// should be appended to "other" or at least before "settings"
if ($current_group == "other" || $p["group"] == "settings") {
// add "other" subheader
if ($current_group != "other") {
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("other"));
$a_form->addItem($sh);
}
foreach ($custom_fields as $custom_field) {
$a_form->addItem($custom_field);
}
$custom_fields_done = true;
}
}
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt($p["group"]));
$a_form->addItem($sh);
$current_group = $p["group"];
}
$m = "";
if (isset($p["method"])) {
$m = $p["method"];
}
$lv = isset($p["lang_var"]) && $p["lang_var"] != "" ? $p["lang_var"] : $f;
switch ($p["input"]) {
case "login":
if ((int) $ilSetting->get('allow_change_loginname') || self::$mode == self::MODE_REGISTRATION) {
$val = new ilTextInputGUI($lng->txt('username'), 'username');
if ($a_user) {
$val->setValue($a_user->getLogin());
}
$val->setMaxLength(32);
$val->setSize(40);
$val->setRequired(true);
} else {
// user account name
$val = new ilNonEditableValueGUI($lng->txt("username"), 'ne_un');
if ($a_user) {
$val->setValue($a_user->getLogin());
}
}
$a_form->addItem($val);
break;
case "text":
if (ilUserProfile::userSettingVisible($f)) {
$ti = new ilTextInputGUI($lng->txt($lv), "usr_" . $f);
if ($a_user) {
$ti->setValue($a_user->{$m}());
}
$ti->setMaxLength($p["maxlength"]);
$ti->setSize($p["size"]);
$ti->setRequired($ilSetting->get("require_" . $f));
if (!$ti->getRequired() || $ti->getValue()) {
$ti->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($ti);
}
break;
case "sel_country":
if (ilUserProfile::userSettingVisible($f)) {
include_once "./Services/Form/classes/class.ilCountrySelectInputGUI.php";
$ci = new ilCountrySelectInputGUI($lng->txt($lv), "usr_" . $f);
if ($a_user) {
$ci->setValue($a_user->{$m}());
}
$ci->setRequired($ilSetting->get("require_" . $f));
if (!$ci->getRequired() || $ci->getValue()) {
$ci->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
}
$a_form->addItem($ci);
}
break;
case "birthday":
if (ilUserProfile::userSettingVisible($f)) {
//.........这里部分代码省略.........
示例7: getInputField
/**
* @param $type_id
* @param ilDataCollectionField $field
* @return ilCheckboxInputGUI|ilDateTimeInputGUI|ilFileInputGUI|ilTextInputGUI|NULL
*/
static function getInputField(ilDataCollectionField $field)
{
global $lng;
$type_id = $field->getDatatypeId();
$title = $field->getTitle();
switch ($type_id) {
case ilDataCollectionDatatype::INPUTFORMAT_TEXT:
$input = new ilTextInputGUI($title, 'field_' . $field->getId());
if ($field->getTextArea()) {
$input = new ilTextAreaInputGUI($title, 'field_' . $field->getId());
}
if ($field->getLength()) {
$input->setInfo($lng->txt("dcl_max_text_length") . ": " . $field->getLength());
if (!$field->getTextArea()) {
$input->setMaxLength($field->getLength());
}
}
break;
case ilDataCollectionDatatype::INPUTFORMAT_NUMBER:
$input = new ilTextInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN:
$input = new ilCheckboxInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_DATETIME:
$input = new ilDateTimeInputGUI($title, 'field_' . $field->getId());
$input->setStartYear(date("Y") - 100);
break;
case ilDataCollectionDatatype::INPUTFORMAT_FILE:
$input = new ilFileInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_REFERENCE:
if (!$field->isNRef()) {
$input = new ilSelectInputGUI($title, 'field_' . $field->getId());
} else {
$input = new ilMultiSelectInputGUI($title, 'field_' . $field->getId());
}
break;
case ilDataCollectionDatatype::INPUTFORMAT_RATING:
$input = new ilTextInputGUI($title, 'field_' . $field->getId());
$input->setValue($lng->txt("dcl_editable_in_table_gui"));
$input->setDisabled(true);
break;
case ilDataCollectionDatatype::INPUTFORMAT_ILIAS_REF:
$input = new ilDataCollectionTreePickInputGUI($title, 'field_' . $field->getId());
break;
case ilDataCollectionDatatype::INPUTFORMAT_MOB:
$input = new ilImageFileInputGUI($title, 'field_' . $field->getId());
$input->setAllowDeletion(true);
break;
}
if ($field->getDescription()) {
$input->setInfo($field->getDescription() . ($input->getInfo() ? "<br>" . $input->getInfo() : ""));
}
return $input;
}
示例8: initAddNewEntryForm
protected function initAddNewEntryForm($a_id = null)
{
global $ilCtrl;
if (!$a_id) {
$a_id = $_POST["id"];
}
if (!$a_id || !in_array($a_id, ilObjLanguageAccess::_getSavedTopics())) {
$ilCtrl->redirect($this, "view");
}
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "saveNewEntry"));
$form->setTitle($this->lng->txt("adm_missing_entry_add"));
$mods = ilObjLanguageAccess::_getSavedModules();
$options = array_combine($mods, $mods);
$mod = new ilSelectInputGUI(ucfirst($this->lng->txt("module")), "mod");
$mod->setOptions(array("" => $this->lng->txt("please_select")) + $options);
$mod->setRequired(true);
$form->addItem($mod);
$id = new ilTextInputGUI(ucfirst($this->lng->txt("identifier")), "id");
$id->setValue($a_id);
$id->setDisabled(true);
$form->addItem($id);
foreach ($this->lng->getInstalledLanguages() as $lang_key) {
$trans = new ilTextInputGUI($this->lng->txt("meta_l_" . $lang_key), "trans_" . $lang_key);
if (in_array($lang_key, array("de", "en"))) {
$trans->setRequired(true);
}
$form->addItem($trans);
}
$form->addCommandButton("saveNewEntry", $this->lng->txt("save"));
$form->addCommandButton("view", $this->lng->txt("cancel"));
return $form;
}
示例9: buildForm
private function buildForm()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
$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);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($this->testOBJ->participantDataExist()) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->testOBJ->getAnonymity());
$form->addItem($anonymity);
// test mode (question set type)
$questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
$questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
$questSetType->addOption($questSetTypeFixed);
$questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
$questSetType->addOption($questSetTypeRandom);
$questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
$questSetType->addOption($questSetTypeContinues);
$questSetType->setValue($this->testOBJ->getQuestionSetType());
if ($this->testOBJ->participantDataExist()) {
$questSetType->setDisabled(true);
}
$form->addItem($questSetType);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->testOBJ->getPoolUsage());
$form->addItem($pool_usage);
// enable_archiving
$enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
$enable_archiving->setValue(1);
$enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
$form->addItem($enable_archiving);
// activation/availability (no template support yet)
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->testOBJ->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->setChecked($this->testOBJ->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
$act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
$opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
$act_type->addOption($opt);
$opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
$opt->setInfo($this->lng->txt('tst_availability_until_info'));
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI("", "access_period");
$dur->setShowTime(true);
$date = $this->testOBJ->getActivationStartingTime();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->testOBJ->getActivationEndingTime();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$opt->addSubItem($dur);
//.........这里部分代码省略.........
示例10: initFormRoleProperties
/**
* Create role prperty form
* @return
* @param int $a_mode
*/
protected function initFormRoleProperties($a_mode)
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
if ($this->creation_mode) {
$this->ctrl->setParameter($this, "new_type", 'role');
}
$this->form->setFormAction($this->ctrl->getFormAction($this));
switch ($a_mode) {
case self::MODE_GLOBAL_CREATE:
$this->form->setTitle($this->lng->txt('role_new'));
$this->form->addCommandButton('save', $this->lng->txt('role_new'));
break;
case self::MODE_GLOBAL_UPDATE:
$this->form->setTitle($this->lng->txt('role_edit'));
$this->form->addCommandButton('update', $this->lng->txt('save'));
break;
case self::MODE_LOCAL_CREATE:
case self::MODE_LOCAL_UPDATE:
}
// Fix cancel
$this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
$title = new ilTextInputGUI($this->lng->txt('title'), 'title');
if (ilObjRole::isAutoGenerated($this->object->getId())) {
$title->setDisabled(true);
}
$title->setValidationRegexp('/^(?!il_).*$/');
$title->setValidationFailureMessage($this->lng->txt('msg_role_reserved_prefix'));
$title->setSize(40);
$title->setMaxLength(70);
$title->setRequired(true);
$this->form->addItem($title);
$desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
if (ilObjRole::isAutoGenerated($this->object->getId())) {
$desc->setDisabled(true);
}
$desc->setCols(40);
$desc->setRows(3);
$this->form->addItem($desc);
if ($this->rolf_ref_id == ROLE_FOLDER_ID) {
$reg = new ilCheckboxInputGUI($this->lng->txt('allow_register'), 'reg');
$reg->setValue(1);
#$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info'));
$this->form->addItem($reg);
$la = new ilCheckboxInputGUI($this->lng->txt('allow_assign_users'), 'la');
$la->setValue(1);
#$la->setInfo($this->lng->txt('rbac_local_admin_info'));
$this->form->addItem($la);
}
$pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'pro');
$pro->setValue(1);
#$pro->setInfo($this->lng->txt('role_protext_permission_info'));
$this->form->addItem($pro);
include_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
if (ilDiskQuotaActivationChecker::_isActive()) {
$quo = new ilNumberInputGUI($this->lng->txt('disk_quota'), 'disk_quota');
$quo->setMinValue(0);
$quo->setSize(4);
$quo->setInfo($this->lng->txt('enter_in_mb_desc') . '<br />' . $this->lng->txt('disk_quota_on_role_desc'));
$this->form->addItem($quo);
}
if (ilDiskQuotaActivationChecker::_isPersonalWorkspaceActive()) {
$this->lng->loadLanguageModule("file");
$wquo = new ilNumberInputGUI($this->lng->txt('personal_workspace_disk_quota'), 'wsp_disk_quota');
$wquo->setMinValue(0);
$wquo->setSize(4);
$wquo->setInfo($this->lng->txt('enter_in_mb_desc') . '<br />' . $this->lng->txt('disk_quota_on_role_desc'));
$this->form->addItem($wquo);
}
return true;
}
示例11: initEditForm
/**
* Init edit settings form
*
* @return ilPropertyFormGUI
*/
protected function initEditForm()
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('ecs_general_info'));
$form->addCommandButton('update', $this->lng->txt('save'));
$form->addCommandButton('edit', $this->lng->txt('cancel'));
$text = new ilTextInputGUI($this->lng->txt('title'), 'title');
$text->setValue($this->object->getTitle());
$text->setSize(40);
$text->setMaxLength(128);
$text->setDisabled(true);
$form->addItem($text);
$area = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
$area->setValue($this->object->getDescription());
$area->setRows(3);
$area->setCols(80);
$area->setDisabled(true);
$form->addItem($area);
$area = new ilTextAreaInputGUI($this->lng->txt('ecs_local_information'), 'local_info');
$area->setValue($this->object->getLocalInformation());
$area->setRows(3);
$area->setCols(80);
$form->addItem($area);
$this->addCustomEditForm($form);
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
$record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, $this->getType(), $this->object->getId());
$record_gui->setPropertyForm($form);
$record_gui->parse();
return $form;
}
示例12: initBasicSettingsForm
/**
* Init basic settings form.
*/
public function initBasicSettingsForm()
{
global $lng, $ilSetting;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$lng->loadLanguageModule("pd");
// installation short title
$ti = new ilTextInputGUI($this->lng->txt("short_inst_name"), "short_inst_name");
$ti->setMaxLength(200);
$ti->setSize(40);
$ti->setValue($ilSetting->get("short_inst_name"));
$ti->setInfo($this->lng->txt("short_inst_name_info"));
$this->form->addItem($ti);
// public section
$cb = new ilCheckboxInputGUI($this->lng->txt("pub_section"), "pub_section");
$cb->setInfo($lng->txt("pub_section_info"));
if ($ilSetting->get("pub_section")) {
$cb->setChecked(true);
}
// search engine
include_once 'Services/PrivacySecurity/classes/class.ilRobotSettings.php';
$robot_settings = ilRobotSettings::_getInstance();
$cb2 = new ilCheckboxInputGUI($this->lng->txt("search_engine"), "open_google");
$cb2->setInfo($this->lng->txt("enable_search_engine"));
$cb->addSubItem($cb2);
if (!$robot_settings->checkModRewrite()) {
$cb2->setAlert($lng->txt("mod_rewrite_disabled"));
$cb2->setChecked(false);
$cb2->setDisabled(true);
} elseif (!$robot_settings->checkRewrite()) {
$cb2->setAlert($lng->txt("allow_override_alert"));
$cb2->setChecked(false);
$cb2->setDisabled(true);
} else {
if ($ilSetting->get("open_google")) {
$cb2->setChecked(true);
}
}
// Enable Global Profiles
$cb_prop = new ilCheckboxInputGUI($lng->txt('pd_enable_user_publish'), 'enable_global_profiles');
$cb_prop->setInfo($lng->txt('pd_enable_user_publish_info'));
$cb_prop->setChecked($ilSetting->get('enable_global_profiles'));
$cb->addSubItem($cb_prop);
// activate captcha for anonymous wiki/forum editing
include_once "./Services/Captcha/classes/class.ilCaptchaUtil.php";
$cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_wiki_forum'), 'activate_captcha_anonym');
$cap->setValue(1);
if (ilCaptchaUtil::checkFreetype()) {
$cap->setChecked($ilSetting->get('activate_captcha_anonym'));
} else {
$cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
}
$cb->addSubItem($cap);
$this->form->addItem($cb);
// default repository view
$options = array("flat" => $lng->txt("flatview"), "tree" => $lng->txt("treeview"));
$si = new ilSelectInputGUI($this->lng->txt("def_repository_view"), "default_rep_view");
$si->setOptions($options);
$si->setInfo($this->lng->txt(""));
if ($ilSetting->get("default_repository_view") == "tree") {
$si->setValue("tree");
} else {
$si->setValue("flat");
}
$this->form->addItem($si);
//
$options = array("" => $lng->txt("adm_rep_tree_only_container"), "tree" => $lng->txt("adm_all_resource_types"));
// repository tree
$radg = new ilRadioGroupInputGUI($lng->txt("adm_rep_tree_presentation"), "tree_pres");
$radg->setValue($ilSetting->get("repository_tree_pres"));
$op1 = new ilRadioOption($lng->txt("adm_rep_tree_only_cntr"), "", $lng->txt("adm_rep_tree_only_cntr_info"));
$radg->addOption($op1);
$op2 = new ilRadioOption($lng->txt("adm_rep_tree_all_types"), "all_types", $lng->txt("adm_rep_tree_all_types_info"));
// limit tree in courses and groups
$cb = new ilCheckboxInputGUI($lng->txt("adm_rep_tree_limit_grp_crs"), "rep_tree_limit_grp_crs");
$cb->setChecked($ilSetting->get("rep_tree_limit_grp_crs"));
$cb->setInfo($lng->txt("adm_rep_tree_limit_grp_crs_info"));
$op2->addSubItem($cb);
$radg->addOption($op2);
$this->form->addItem($radg);
$sdesc = new ilCheckboxInputGUI($lng->txt("adm_rep_shorten_description"), "rep_shorten_description");
$sdesc->setInfo($lng->txt("adm_rep_shorten_description_info"));
$sdesc->setChecked($ilSetting->get("rep_shorten_description"));
$this->form->addItem($sdesc);
$sdesclen = new ilTextInputGUI($lng->txt("adm_rep_shorten_description_length"), "rep_shorten_description_length");
$sdesclen->setValue($ilSetting->get("rep_shorten_description_length"));
$sdesclen->setSize(3);
$sdesc->addSubItem($sdesclen);
// synchronize repository tree with main view
$cb = new ilCheckboxInputGUI($lng->txt("adm_synchronize_rep_tree"), "rep_tree_synchronize");
$cb->setInfo($lng->txt("adm_synchronize_rep_tree_info"));
$cb->setChecked($ilSetting->get("rep_tree_synchronize"));
$this->form->addItem($cb);
// repository access check
/* $options = array(
0 => "0",
10 => "10",
//.........这里部分代码省略.........
示例13: propertiesObject
/**
* Display and fill the properties form of the test
*
* @access public
*/
function propertiesObject($checkonly = FALSE)
{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
// allow only write access
ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
$this->ctrl->redirect($this, "infoScreen");
}
// using template?
$template_settings = null;
$template = $this->object->getTemplate();
if ($template) {
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
$template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
$template_settings = $template->getSettings();
$hide_rte_switch = $template_settings["rte_switch"]["hide"];
}
$save = strcmp($this->ctrl->getCmd(), "saveProperties") == 0 ? TRUE : FALSE;
$total = $this->object->evalTotalPersons();
$this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("test_properties");
if (!$template || $template && $this->formShowGeneralSection($template_settings)) {
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("tst_general_properties"));
$form->addItem($header);
}
// title & description (meta data)
include_once 'Services/MetaData/classes/class.ilMD.php';
$md_obj = new ilMD($this->object->getId(), 0, "tst");
$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);
}
// anonymity
$anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
if ($total) {
$anonymity->setDisabled(true);
}
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
$anonymity->addOption($rb);
$rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
$anonymity->addOption($rb);
$anonymity->setValue((int) $this->object->getAnonymity());
$form->addItem($anonymity);
// random selection of questions
$random = new ilCheckboxInputGUI($this->lng->txt("tst_random_selection"), "random_test");
$random->setValue(1);
if ($total) {
$random->setDisabled(true);
}
$random->setChecked($this->object->isRandomTest());
$info = $this->lng->txt("tst_random_test_description");
if ($this->object->hasQuestionsWithoutQuestionpool()) {
$info .= $this->lng->txt("tst_random_test_description_warning");
}
$random->setInfo($info);
$form->addItem($random);
// pool usage
$pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
$pool_usage->setValue(1);
$pool_usage->setChecked($this->object->getPoolUsage());
$form->addItem($pool_usage);
// activation/availability (no template support yet)
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->setChecked($this->object->isOnline());
$online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
$form->addItem($online);
$act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
$act_type->setInfo($act_ref_info);
//.........这里部分代码省略.........
示例14: getInputField
/**
* @param srCertificatePlaceholderValue $placeholder_value
* @param $lang
* @return ilTextInputGUI
*/
protected function getInputField($placeholder_value, $lang)
{
// $label = $placeholder_value->getPlaceholder()->getLabel("en");
$placeholder = $placeholder_value->getPlaceholder();
//$postvar = "placeholder[" . $placeholder_value->getId(). "][" . $lang . "]";
$postvar = "placeholder_" . $placeholder_value->getId() . "_" . $lang;
$label = mb_strtoupper($lang);
if ($placeholder->getMaxCharactersValue() > self::MAX_CHARACTERS_TEXT) {
$input = new ilTextAreaInputGUI($label, $postvar);
} else {
$input = new ilTextInputGUI($label, $postvar);
$input->setMaxLength($placeholder->getMaxCharactersValue());
}
// $input->setInfo("[[" . mb_strtoupper($placeholder_value->getPlaceholder()->getIdentifier()) . "]]");
$input->setDisabled(!$placeholder_value->isEditable());
$input->setValue($placeholder_value->getValue($lang));
$input->setRequired($placeholder->getIsMandatory());
return $input;
}
开发者ID:studer-raimann,项目名称:Certificate,代码行数:24,代码来源:class.srCertificateDefinitionPlaceholdersFormGUI.php
示例15: createAndSetParticipantsMultiTextInput
private function createAndSetParticipantsMultiTextInput($a_bookingData)
{
global $rssPermission;
$participants_input = new ilTextInputGUI($this->lng->txt("rep_robj_xrs_participants_list"), "participants");
$participants_input->setMulti(true);
$ajax_datasource = $this->ctrl->getLinkTarget($this, 'doUserAutoComplete', '', true);
$participants_input->setDataSource($ajax_datasource);
$participants_input->setInfo($this->getMaxRoomAllocationInfo());
if (!empty($a_bookingData[0])) {
$participants_input->setValue($a_bookingData[0]);
}
$participants_input->setMultiValues($a_bookingData);
if ($this->mode == 'show' || !$rssPermission->checkPrivilege(ilRoomSharingPrivilegesConstants::ADD_PARTICIPANTS)) {
$participants_input->setDisabled(true);
}
return $participants_input;
}