36 $this->tree = $DIC->repositoryTree();
37 $this->
ctrl = $DIC->ctrl();
38 $this->
lng = $DIC->language();
39 $this->
lng->loadLanguageModule(
'trac');
44 $this->parent_ref_id = $a_parent_ref_id;
49 $exp->setSkipRootNode(
true);
50 $exp->setRootId($this->parent_ref_id);
51 $white = $this->
getLPTypes($this->parent_ref_id);
52 $exp->setSelectableTypes($white);
53 if (!in_array(
"fold", $white)) {
56 $exp->setTypeWhiteList($white);
63 $mode = $olp->getModeText($olp->getCurrentMode());
64 if (in_array($olp->getCurrentMode(), $invalid_modes)) {
65 $mode =
"<strong>$mode</strong>";
70 $subitems->setRequired(
true);
74 protected function getLPTypes(
int $a_parent_ref_id): array
77 $root = $this->tree->getNodeData($a_parent_ref_id);
78 $sub_items = $this->tree->getSubTree($root);
79 array_shift($sub_items);
81 foreach ($sub_items as $node) {
86 if (count($modes) > 1) {
87 $res[] = $node[
"type"];
96 if (is_array($a_config[
"subitems"])) {
98 $items->setValue($a_config[
"subitems"]);
104 return [
"subitems" => $a_form->
getInput(
"subitems")];
144 return $invalid_modes;
150 $invalid_modes = self::getInvalidLPModes();
154 if (in_array($olp->getCurrentMode(), $invalid_modes)) {
158 if ($invalid !== []) {
159 $mess = sprintf($this->
lng->txt(
"badge_course_lp_invalid"), implode(
", ", $invalid));
initConfigForm(ilPropertyFormGUI $a_form, int $a_parent_ref_id)
Add custom fields to form.
importConfigToForm(ilPropertyFormGUI $a_form, array $a_config)
Set form values.
const LP_MODE_MANUAL_BY_TUTOR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isSupportedObjectType(string $type)
const LP_MODE_COLLECTION_MANUAL
const LP_MODE_COLLECTION_TLT
getLPTypes(int $a_parent_ref_id)
static _lookupObjId(int $ref_id)
static getInvalidLPModes()
static _enabledLearningProgress()
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
validateForm(ilPropertyFormGUI $a_form)
Custom form validation.
const LP_MODE_DEACTIVATED
const LP_MODE_COLLECTION_MOBS
static getTypeClass(string $type)
static getInstance(int $obj_id)
getConfigFromForm(ilPropertyFormGUI $a_form)
Export values to DB.