ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\LearningSequence\Content\Condition\LSOObjectPicker Class Reference

Picker class for LSO objects. More...

+ Collaboration diagram for ILIAS\LearningSequence\Content\Condition\LSOObjectPicker:

Public Member Functions

 __construct (protected UIFactory $ui_factory, protected int $lso_ref_id, protected int $current_item_ref_id,)
 
 getPicker (string $label, bool $multi)
 

Detailed Description

Picker class for LSO objects.

This class is NOT a GUI class and does NOT participate in ilCtrl flow.

Definition at line 30 of file LSOObjectPicker.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningSequence\Content\Condition\LSOObjectPicker::__construct ( protected UIFactory  $ui_factory,
protected int  $lso_ref_id,
protected int  $current_item_ref_id 
)

Definition at line 32 of file LSOObjectPicker.php.

36 {
37 }

Member Function Documentation

◆ getPicker()

ILIAS\LearningSequence\Content\Condition\LSOObjectPicker::getPicker ( string  $label,
bool  $multi 
)

Definition at line 39 of file LSOObjectPicker.php.

39 : FormInput
40 {
41 $lso = \ilObjLearningSequence::getInstanceByRefId($this->lso_ref_id);
42 $lso_items = $lso->getLSItems();
43 $filtered_lso_items = array_filter(
44 $lso_items,
45 fn($item) => $item->getRefId() !== $this->current_item_ref_id
46 );
47
48 $retrieval = new LSOItemNodeRetrieval($filtered_lso_items);
49
50 if ($multi) {
51 return $this->ui_factory->input()->field()->treeMultiSelect($retrieval, $label)
52 ->withSelectChildNodes(false)->withRequired(true);
53 }
54
55 return $this->ui_factory->input()->field()->treeSelect($retrieval, $label)->withRequired(true);
56 }
static getInstanceByRefId(int $ref_id)

References ilObjLearningSequence\getInstanceByRefId().

Referenced by ILIAS\LearningSequence\Content\Condition\InputCondition\LearningProgressInputConditions\LearningProgressInputAwareCondition\getAdditionalForm(), ILIAS\LearningSequence\Content\Condition\InputCondition\PointsInputCondition\PointsInputCondition\getAdditionalForm(), and ILIAS\LearningSequence\Content\Condition\InputCondition\SubsetInputCondition\SubsetInputCondition\getAdditionalForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: