本文整理汇总了PHP中ilTextAreaInputGUI::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextAreaInputGUI::setDisabled方法的具体用法?PHP ilTextAreaInputGUI::setDisabled怎么用?PHP ilTextAreaInputGUI::setDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTextAreaInputGUI
的用法示例。
在下文中一共展示了ilTextAreaInputGUI::setDisabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editWebDAVSettings
/**
* Edit settings.
*/
public function editWebDAVSettings()
{
global $rbacsystem, $ilErr, $ilTabs;
global $tpl, $ilCtrl, $lng, $tree, $settings;
$this->tabs_gui->setTabActive('webdav');
if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
$ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
}
require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
require_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
require_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
require_once "./Services/Form/classes/class.ilRadioOption.php";
require_once "./Services/Form/classes/class.ilTextAreaInputGUI.php";
require_once "./Services/WebDAV/classes/class.ilDAVServer.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt("settings"));
// Enable webdav
$ilDAVServer = ilDAVServer::getInstance();
$isPearAuthHTTPInstalled = @(include_once "Auth/HTTP.php");
$cb_prop = new ilCheckboxInputGUI($lng->txt("enable_webdav"), "enable_webdav");
$cb_prop->setValue('1');
$cb_prop->setChecked($this->object->isWebdavEnabled() && $isPearAuthHTTPInstalled);
$cb_prop->setDisabled(!$isPearAuthHTTPInstalled);
$cb_prop->setInfo($isPearAuthHTTPInstalled ? sprintf($lng->txt('enable_webdav_info'), $ilDAVServer->getMountURI($tree->getRootId(), 0, null, null, true)) : $lng->txt('webdav_pear_auth_http_needed'));
$form->addItem($cb_prop);
// Webdav help text
if ($isPearAuthHTTPInstalled) {
$rgi_prop = new ilRadioGroupInputGUI($lng->txt('webfolder_instructions'), 'custom_webfolder_instructions_choice');
$rgi_prop->addOption(new ilRadioOption($lng->txt('use_default_instructions'), 'default'));
$rgi_prop->addOption(new ilRadioOption($lng->txt('use_customized_instructions'), 'custom'));
$rgi_prop->setValue($this->object->isCustomWebfolderInstructionsEnabled() ? 'custom' : 'default');
$rgi_prop->setDisabled(!$isPearAuthHTTPInstalled);
$form->addItem($rgi_prop);
$tai_prop = new ilTextAreaInputGUI('', 'custom_webfolder_instructions');
$tai_prop->setValue($this->object->getCustomWebfolderInstructions());
$tai_prop->setInfo($lng->txt("webfolder_instructions_info"));
$tai_prop->setCols(80);
$tai_prop->setRows(20);
$tai_prop->setDisabled(!$isPearAuthHTTPInstalled);
$form->addItem($tai_prop);
}
// command buttons
$form->addCommandButton('saveWebDAVSettings', $lng->txt('save'));
$form->addCommandButton('view', $lng->txt('cancel'));
$tpl->setContent($form->getHTML());
}
示例2: initQuestionForm
protected function initQuestionForm($a_read_only = false)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "saveQuestion"));
$form->setTitle($lng->txt("obj_poll"));
$question = new ilTextAreaInputGUI($lng->txt("poll_question"), "question");
$question->setRequired(true);
$question->setCols(40);
$question->setRows(2);
$question->setValue($this->object->getQuestion());
$question->setDisabled($a_read_only);
$form->addItem($question);
$dimensions = " (" . ilObjPoll::getImageSize() . "px)";
$img = new ilImageFileInputGUI($lng->txt("poll_image") . $dimensions, "image");
$img->setDisabled($a_read_only);
$form->addItem($img);
// show existing file
$file = $this->object->getImageFullPath(true);
if ($file) {
$img->setImage($file);
}
$anonymous = new ilRadioGroupInputGUI($lng->txt("poll_mode"), "mode");
$anonymous->setRequired(true);
$option = new ilRadioOption($lng->txt("poll_mode_anonymous"), 0);
$option->setInfo($lng->txt("poll_mode_anonymous_info"));
$anonymous->addOption($option);
$option = new ilRadioOption($lng->txt("poll_mode_personal"), 1);
$option->setInfo($lng->txt("poll_mode_personal_info"));
$anonymous->addOption($option);
$anonymous->setValue($this->object->getNonAnonymous());
$anonymous->setDisabled($a_read_only);
$form->addItem($anonymous);
$nanswers = new ilNumberInputGUI($lng->txt("poll_max_number_of_answers"), "nanswers");
$nanswers->setRequired(true);
$nanswers->setMinValue(1);
$nanswers->setSize(3);
$nanswers->setValue($this->object->getMaxNumberOfAnswers());
$nanswers->setDisabled($a_read_only);
$form->addItem($nanswers);
$answers = new ilTextInputGUI($lng->txt("poll_answers"), "answers");
$answers->setRequired(true);
$answers->setMulti(true, true);
$answers->setDisabled($a_read_only);
$form->addItem($answers);
$multi_answers = array();
foreach ($this->object->getAnswers() as $idx => $item) {
if (!$idx) {
$answers->setValue($item["answer"]);
}
$multi_answers[] = $item["answer"];
}
$answers->setMultiValues($multi_answers);
if (!$a_read_only) {
$form->addCommandButton("saveQuestion", $lng->txt("save"));
}
return $form;
}
示例3: 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));
}
示例4: 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)) {
//.........这里部分代码省略.........
示例5: 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;
}
示例6: 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;
}