24include_once(
'./Services/ContainerReference/classes/class.ilContainerReferenceGUI.php');
51 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
55 $this->logger =
$DIC->logger()->crsr();
59 $this->lng->loadLanguageModule(
'crs');
74 $next_class = $this->ctrl->getNextClass($this);
75 switch ($next_class) {
76 case 'illearningprogressgui':
78 $this->tabs_gui->activateTab(
'learning_progress');
79 $lp_gui = new \ilLearningProgressGUI(
81 $this->object->getRefId(),
84 $this->ctrl->forwardCommand($lp_gui);
87 parent::executeCommand();
102 if ($this->access->checkAccess(
'write',
'', $this->object->getRefId())) {
103 $this->tabs_gui->addTab(
105 $this->lng->txt(
'settings'),
106 $this->ctrl->getLinkTarget($this,
'edit')
111 $this->tabs_gui->addTab(
113 $this->lng->txt(
'learning_progress'),
114 $this->ctrl->getLinkTargetByClass(
116 ilObjCourseReferenceGUI::class,
117 ilLearningProgressGUI::class
123 if ($this->access->checkAccess(
'edit_permission',
'', $this->object->getRefId())) {
124 $this->tabs_gui->addTab(
126 $this->lng->txt(
'perm_settings'),
127 $this->ctrl->getLinkTargetByClass(
129 ilObjCourseReferenceGUI::class,
130 ilPermissionGUI::class
142 public function initForm($a_mode = self::MODE_EDIT)
144 $form = parent::initForm($a_mode);
146 if ($a_mode == self::MODE_CREATE) {
154 if (!$path_info->hasParentCourse()) {
158 $access = $path_info->checkManagmentAccess();
160 $auto_update = new \ilCheckboxInputGUI($this->lng->txt(
'crs_ref_member_update'),
'member_update');
161 $auto_update->setChecked($this->object->isMemberUpdateEnabled());
162 $auto_update->setInfo($this->lng->txt(
'crs_ref_member_update_info'));
163 $auto_update->setDisabled(!
$access);
164 $form->addItem($auto_update);
176 $ok = parent::loadPropertiesFromSettingsForm(
$form);
180 $auto_update =
$form->getInput(
'member_update');
181 if ($auto_update && !$path_info->hasParentCourse()) {
183 $form->getItemByPostVar(
'member_update')->setAlert($this->lng->txt(
'crs_ref_missing_parent_crs'));
185 if ($auto_update && !$path_info->checkManagmentAccess()) {
187 $form->getItemByPostVar(
'member_update')->setAlert($this->lng->txt(
'crs_ref_missing_access'));
191 $this->
object->enableMemberUpdate((
bool) $form->
getInput(
'member_update'));
203 public static function _goto($a_target)
211 $target_ref_id = $a_target;
212 $write_access =
$access->checkAccess(
'write',
'', (
int) $target_ref_id);
216 $target_class = \ilObjCourseReferenceGUI::class;
219 $target_class = \ilObjCourseGUI::class;
222 $ctrl->initBaseClass(ilRepositoryGUI::class);
223 $ctrl->setParameterByClass($target_class,
'ref_id', $target_ref_id);
224 $ctrl->redirectByClass(
226 \ilRepositoryGUI::class,
An exception for terminatinating execution or to throw for unit testing.
getReferenceType()
get reference type
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
static getInstanceByRefId(int $ref_id, int $target_ref_id=0)
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
initForm($a_mode=self::MODE_EDIT)
Init title form.ilPropertyFormGUI
executeCommand()
Execute command.
static _goto($a_target)
Support for goto php.
loadPropertiesFromSettingsForm(ilPropertyFormGUI $form)
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
prepareOutput($a_show_subobjects=true)
prepare output
static _lookupObjId($a_id)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc