/**
  * Add all fields to the form
  */
 protected function initForm()
 {
     $this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
     $this->setTitle($this->lng->txt('orgu_settings'));
     $item = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $item->setRequired(true);
     $item->setValue($this->obj_orgu->getTitle());
     $this->addItem($item);
     $item = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $item->setValue($this->obj_orgu->getDescription());
     $this->addItem($item);
     $item = new ilFormSectionHeaderGUI();
     $item->setTitle($this->lng->txt('orgu_type'));
     $this->addItem($item);
     $types = ilOrgUnitType::getAllTypes();
     $options = array(0 => '');
     /** @var ilOrgUnitType $type */
     foreach ($types as $type) {
         $options[$type->getId()] = $type->getTitle();
     }
     asort($options);
     $item = new ilSelectInputGUI($this->lng->txt('orgu_type'), 'orgu_type');
     $item->setOptions($options);
     $item->setValue($this->obj_orgu->getOrgUnitTypeId());
     $this->addItem($item);
     $item = new ilFormSectionHeaderGUI();
     $item->setTitle($this->lng->txt('ext_id'));
     $this->addItem($item);
     $item = new ilTextInputGUI($this->lng->txt('ext_id'), 'ext_id');
     $item->setValue($this->obj_orgu->getImportId());
     $this->addItem($item);
     $this->addCommandButton('updateSettings', $this->lng->txt('save'));
 }
 /**
  * called by prepare output
  */
 public function setTitleAndDescription()
 {
     # all possible create permissions
     //$possible_ops_ids = $rbacreview->getOperationsByTypeAndClass('orgu', 'create');
     parent::setTitleAndDescription();
     if ($this->object->getTitle() == "__OrgUnitAdministration") {
         $this->tpl->setTitle($this->lng->txt("objs_orgu"));
         $this->tpl->setDescription($this->lng->txt("objs_orgu"));
     }
     // Check for custom icon of type
     if ($this->ilias->getSetting('custom_icons')) {
         $icons_cache = ilObjOrgUnit::getIconsCache();
         $icon_file = isset($icons_cache[$this->object->getId()]) ? $icons_cache[$this->object->getId()] : '';
         if ($icon_file) {
             $this->tpl->setTitleIcon($icon_file, $this->lng->txt("obj_" . $this->object->getType()));
         }
     }
 }