/** * @return bool */ public function saveObject() { if (!$this->fillObject()) { return false; } if ($this->isNew) { $this->type->create(); } else { $this->type->update(); } return true; }
} ?> <#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'; $body = "Hi,\n\n" . "A new certificate was generated for you:\n\n" . "User: [[USER_FULLNAME]]\n" . "Course: [[COURSE_TITLE]]\n" . "Valid until: [[CERT_VALID_TO]]\n\n" . "The certificate is attached in this email"; ilCertificateConfig::set('notification_user_body', $body); ilCertificateConfig::set('notification_user_subject', 'New certificate generated for course [[COURSE_TITLE]]');