/** * 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')); }
/** * Build and set data for table. */ protected function buildData() { $types = ilOrgUnitType::getAllTypes(); $data = array(); /** @var $type ilOrgUnitType */ foreach ($types as $type) { $row = array(); $row['id'] = $type->getId(); $row['title'] = $type->getTitle($type->getDefaultLang()); $row['default_language'] = $type->getDefaultLang(); $row['description'] = $type->getDescription($type->getDefaultLang()); $row['icon'] = $type->getIcon(); $data[] = $row; } $this->setData($data); }