本文整理汇总了PHP中ilTextInputGUI::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextInputGUI::getValue方法的具体用法?PHP ilTextInputGUI::getValue怎么用?PHP ilTextInputGUI::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTextInputGUI
的用法示例。
在下文中一共展示了ilTextInputGUI::getValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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)) {
//.........这里部分代码省略.........