72 string $certificatePath,
73 bool $hasAdditionalElements,
95 $hasAdditionalElements,
100 $placeholderDescriptionObject
125 if (null ===
$tree) {
127 $tree = $DIC[
'tree'];
149 $form = $this->settingsFromFactory->createForm($certificateGUI);
151 $objectLearningProgressSettings =
new ilLPObjSettings($this->object->getId());
153 $mode = $objectLearningProgressSettings->
getMode();
157 $formSection = new \ilFormSectionHeaderGUI();
159 $form->addItem($formSection);
161 $exp = $subitems->getExplorerGUI();
162 $exp->setSkipRootNode(
true);
163 $exp->setRootId($this->object->getRefId());
164 $exp->setTypeWhiteList($this->
getLPTypes($this->object->getId()));
177 $mode = $olp->getModeText($olp->getCurrentMode());
179 if (in_array($olp->getCurrentMode(), $invalid_modes)) {
180 $mode =
'<strong>' . $mode .
'</strong>';
182 return $objectHelper->lookupTitle($obj_id) .
' (' . $mode .
')';
185 $subitems->setRequired(
true);
186 $form->addItem($subitems);
195 public function save(array $formFields)
199 $titlesOfObjectsWithInvalidModes = array();
201 if (isset($formFields[
'subitems'])) {
202 $refIds = $formFields[
'subitems'];
205 foreach ($refIds as
$refId) {
206 $objectId = $this->objectHelper->lookupObjId((
int) $refId);
209 if (in_array($currentMode, $invalidModes)) {
210 $titlesOfObjectsWithInvalidModes[] = $this->objectHelper->lookupTitle($objectId);
214 if (
sizeof($titlesOfObjectsWithInvalidModes)) {
215 $message = sprintf($this->
language->txt(
'certificate_learning_progress_must_be_active'), implode(
', ', $titlesOfObjectsWithInvalidModes));
219 $this->setting->set(
'cert_subitems_' . $this->object->getId(), json_encode($formFields[
'subitems']));
228 $formFields = $this->settingsFromFactory->fetchFormFieldData($content);
230 $formFields[
'subitems'] = json_decode($this->setting->get(
'cert_subitems_' . $this->object->getId(), json_encode(array())));
231 if ($formFields[
'subitems'] ===
'null' || $formFields[
'subitems'] === null) {
232 $formFields[
'subitems'] = array();
245 $root = $this->tree->getNodeData($a_parent_ref_id);
246 $sub_items = $this->tree->getSubTree($root);
247 array_shift($sub_items);
249 foreach ($sub_items as $node) {
250 if ($this->lpHelper->isSupportedObjectType($node[
'type'])) {
251 $class = $this->lpHelper->getTypeClass($node[
'type']);
252 $modes = $class::getDefaultModes($this->trackingHelper->enabledLearningProgress());
254 if (
sizeof($modes) > 1) {
268 $invalid_modes = array(
274 if (!$this->trackingHelper->enabledLearningProgress()) {
288 return $invalid_modes;
This class provides processing control methods.
const LP_MODE_MANUAL_BY_TUTOR
const LP_MODE_COLLECTION_MANUAL
const LP_MODE_COLLECTION_TLT
getId()
get object id public
GUI class to create PDF certificates.
const LP_MODE_DEACTIVATED
const LP_MODE_COLLECTION_MOBS
static getInstance($a_obj_id)