예제 #1
0
 /**
  * Init contact information form.
  */
 public function initContactInformationForm()
 {
     global $lng, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // first name
     $ti = new ilTextInputGUI($this->lng->txt("firstname"), "admin_firstname");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     $ti->setRequired(true);
     $ti->setValue($ilSetting->get("admin_firstname"));
     $this->form->addItem($ti);
     // last name
     $ti = new ilTextInputGUI($this->lng->txt("lastname"), "admin_lastname");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     $ti->setRequired(true);
     $ti->setValue($ilSetting->get("admin_lastname"));
     $this->form->addItem($ti);
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "admin_title");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     $ti->setValue($ilSetting->get("admin_title"));
     $this->form->addItem($ti);
     // position
     $ti = new ilTextInputGUI($this->lng->txt("position"), "admin_position");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     $ti->setValue($ilSetting->get("admin_position"));
     $this->form->addItem($ti);
     // institution
     $ti = new ilTextInputGUI($this->lng->txt("institution"), "admin_institution");
     $ti->setMaxLength(200);
     $ti->setSize(40);
     $ti->setValue($ilSetting->get("admin_institution"));
     $this->form->addItem($ti);
     // street
     $ti = new ilTextInputGUI($this->lng->txt("street"), "admin_street");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     //$ti->setRequired(true);
     $ti->setValue($ilSetting->get("admin_street"));
     $this->form->addItem($ti);
     // zip code
     $ti = new ilTextInputGUI($this->lng->txt("zipcode"), "admin_zipcode");
     $ti->setMaxLength(10);
     $ti->setSize(5);
     //$ti->setRequired(true);
     $ti->setValue($ilSetting->get("admin_zipcode"));
     $this->form->addItem($ti);
     // city
     $ti = new ilTextInputGUI($this->lng->txt("city"), "admin_city");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     //$ti->setRequired(true);
     $ti->setValue($ilSetting->get("admin_city"));
     $this->form->addItem($ti);
     // country
     $ti = new ilTextInputGUI($this->lng->txt("country"), "admin_country");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     //$ti->setRequired(true);
     $ti->setValue($ilSetting->get("admin_country"));
     $this->form->addItem($ti);
     // phone
     $ti = new ilTextInputGUI($this->lng->txt("phone"), "admin_phone");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     //$ti->setRequired(true);
     $ti->setValue($ilSetting->get("admin_phone"));
     $this->form->addItem($ti);
     // email
     $ti = new ilEmailInputGUI($this->lng->txt("email"), "admin_email");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     $ti->setRequired(true);
     $ti->allowRFC822(true);
     $ti->setValue($ilSetting->get("admin_email"));
     $this->form->addItem($ti);
     // feedback recipient
     $ti = new ilEmailInputGUI($this->lng->txt("feedback_recipient"), "feedback_recipient");
     $ti->setInfo(sprintf($this->lng->txt("feedback_recipient_info"), $this->lng->txt("contact_sysadmin")));
     $ti->setMaxLength(64);
     $ti->setSize(40);
     $ti->setRequired(true);
     $ti->allowRFC822(true);
     $ti->setValue($ilSetting->get("feedback_recipient"));
     $this->form->addItem($ti);
     // error recipient
     $ti = new ilEmailInputGUI($this->lng->txt("error_recipient"), "error_recipient");
     $ti->setMaxLength(64);
     $ti->setSize(40);
     $ti->allowRFC822(true);
     $ti->setValue($ilSetting->get("error_recipient"));
     $this->form->addItem($ti);
     $this->form->addCommandButton("saveContactInformation", $lng->txt("save"));
     $this->form->setTitle($lng->txt("contact_data"));
     $this->form->setFormAction($this->ctrl->getFormAction($this));
 }