Esempio n. 1
0
 /**
  * Init map creation/update form
  */
 function initForm($a_mode)
 {
     global $ilCtrl, $lng;
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     if ($a_mode == "create") {
         $this->form->setTitle($this->lng->txt("cont_insert_map"));
     } else {
         $this->form->setTitle($this->lng->txt("cont_update_map"));
     }
     // location
     $loc_prop = new ilLocationInputGUI($this->lng->txt("cont_location"), "location");
     $loc_prop->setRequired(true);
     $this->form->addItem($loc_prop);
     // width
     $width_prop = new ilNumberInputGUI($this->lng->txt("cont_width"), "width");
     $width_prop->setSize(4);
     $width_prop->setMaxLength(4);
     $width_prop->setRequired(true);
     $width_prop->setMinValue(250);
     $this->form->addItem($width_prop);
     // height
     $height_prop = new ilNumberInputGUI($this->lng->txt("cont_height"), "height");
     $height_prop->setSize(4);
     $height_prop->setMaxLength(4);
     $height_prop->setRequired(true);
     $height_prop->setMinValue(200);
     $this->form->addItem($height_prop);
     // horizonal align
     $align_prop = new ilSelectInputGUI($this->lng->txt("cont_align"), "horizontal_align");
     $options = array("Left" => $lng->txt("cont_left"), "Center" => $lng->txt("cont_center"), "Right" => $lng->txt("cont_right"), "LeftFloat" => $lng->txt("cont_left_float"), "RightFloat" => $lng->txt("cont_right_float"));
     $align_prop->setOptions($options);
     $this->form->addItem($align_prop);
     // caption
     $caption_prop = new ilTextAreaInputGUI($this->lng->txt("cont_caption"), "caption");
     $this->form->addItem($caption_prop);
     // save/cancel buttons
     if ($a_mode == "create") {
         $this->form->addCommandButton("create_map", $lng->txt("save"));
         $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     } else {
         $this->form->addCommandButton("update_map", $lng->txt("save"));
         $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     }
     //$html = $form->getHTML();
 }