/** * @return bool */ protected function fillObject() { $this->setValuesByPost(); // Hacky: The file input must accept only valid suffixes depending on the chosen template type $template_type = srCertificateTemplateTypeFactory::getById((int) $_POST['template_type_id']); /** @var ilFileInputGUI $file_input */ $file_input = $this->getItemByPostVar('template_file'); $file_input->setSuffixes($template_type->getValidSuffixes()); if (!$this->checkInput()) { return false; } $this->type->setTemplateTypeId($this->getInput('template_type_id')); return true; }
} if (!$ilDB->tableColumnExists('uihkcertificate_c', 'name')) { $ilDB->renameTableColumn('uihkcertificate_c', 'config_key', 'name'); } ?> <#11> <?php // We will add one default certificate definition for easier installation. require_once './Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/Certificate/classes/Definition/class.srCertificateDefinition.php'; $type = new srCertificateType(); $type->setTitle("Default Certificate"); $type->setLanguages(array('en')); $type->setRoles(array(2)); //2 Is the default administration role. $type->setAvailableObjects(array('crs')); $type->setTemplateTypeId(1); // JasperReport $type->storeTemplateFileFromServer(ILIAS_ABSOLUTE_PATH . '/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/Certificate/resources/template.jrxml'); $type->create(); // $placeholder = new srCertificatePlaceholder(); // $placeholder->setCertificateType($type); // $placeholder->setIdentifier('crs_title'); // $placeholder->setIsMandatory(true); // $placeholder->setEditableIn(array('crs')); // $placeholder->setLabel('Course Title', 'en'); // $placeholder->create(); ?> <#12> <?php // Add some new config settings require_once './Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/Certificate/classes/class.ilCertificateConfig.php';