/**
  * Get dropdown for choosing the certificate type
  *
  * @return ilSelectInputGUI
  */
 protected function getTypeInput()
 {
     $types = srcertificateType::get();
     $options = array();
     $object_type = $this->pl->isCourseTemplate((int) $_GET['ref_id']) ? 'crs-tpl' : ilObject::_lookupType((int) $_GET['ref_id'], true);
     /** @var $type srCertificateType */
     $invalid = array();
     foreach ($types as $type) {
         if (!srCertificateType::isSelectable($type, (int) $_GET['ref_id'])) {
             continue;
         }
         // Skip the type if it contains no valid template file!
         if (!is_file($type->getCertificateTemplatesPath(true))) {
             $invalid[] = $type->getTitle();
             continue;
         }
         $options[$type->getId()] = $type->getTitle();
     }
     if (count($invalid) && $this->isNew) {
         ilUtil::sendInfo(sprintf($this->pl->txt('msg_info_invalid_cert_types'), implode(', ', $invalid)));
     }
     $item = new ilSelectInputGUI($this->pl->txt('setting_id_type'), 'type_id');
     asort($options);
     $item->setOptions($options);
     $info = $this->isNew ? $this->pl->txt('setting_id_type_info_new') : $this->pl->txt('setting_id_type_info_change');
     $item->setInfo($info);
     $item->setValue($this->definition->getTypeId());
     $item->setRequired(true);
     return $item;
 }
 /**
  * Update type of definition
  *
  */
 public function updateType()
 {
     $new_type_id = (int) $_POST['type_id'];
     if ($new_type_id && $new_type_id != $this->definition->getTypeId()) {
         $this->definition->setTypeId($new_type_id);
         $this->definition->update();
         ilUtil::sendSuccess($this->pl->txt('msg_type_updated'), true);
     }
     $this->ctrl->redirect($this, 'showDefinition');
 }