ILIAS  release_8 Revision v8.24
ilECSMappingSettingsGUI Class Reference

Class for ECS node and directory mapping settings. More...

+ Collaboration diagram for ilECSMappingSettingsGUI:

Public Member Functions

 __construct (ilECSSettingsGUI $settingsContainer, int $server_id, int $mid)
 Constructor. More...
 
 getContainer ()
 Get container object. More...
 
 getServer ()
 
 getMid ()
 Get mid. More...
 
 executeCommand ()
 ilCtrl executeCommand More...
 
 cancel ()
 return to parent container More...
 

Data Fields

const TAB_DIRECTORY = 1
 
const TAB_COURSE = 2
 

Protected Member Functions

 cStart ()
 Goto default page. More...
 
 dStart ()
 Goto default page. More...
 
 cInitOverview ($form=null, $current_attribute=null)
 Show overview page. More...
 
 cAddAttribute ()
 Add one attribute in form. More...
 
 cDeleteAttribute ()
 Delete last attribute in form. More...
 
 cShowLocalExplorer ()
 Show local explorer. More...
 
 cInitMappingForm (int $current_node, $current_attribute)
 Init the mapping form. More...
 
 cSaveOverview ()
 Save overview. More...
 
 cDeleteRulesOfNode ()
 
 cSettings (ilPropertyFormGUI $form=null)
 Show course allocation. More...
 
 initFormCSettings ()
 Init settings form. More...
 
 dSettings (ilPropertyFormGUI $form=null)
 Show directory allocation. More...
 
 cUpdateSettings ()
 Update course settings. More...
 
 dUpdateSettings ()
 Update node mapping settings. More...
 
 initFormDSettings ()
 
 dTrees ()
 Show directory trees. More...
 
 dConfirmDeleteTree ()
 Delete tree settings. More...
 
 dDeleteTree ()
 Delete tree. More...
 
 dEditTree (ilPropertyFormGUI $form=null)
 Edit directory tree assignments. More...
 
 dInitFormTreeSettings (ilPropertyFormGUI $form=null)
 Init form settings. More...
 
 dUpdateTreeSettings ()
 
 dSynchronizeTree ()
 Synchronize Tree. More...
 
 dSynchronizeTrees ()
 
 dShowLocalExplorer ()
 Show local explorer. More...
 
 dShowCmsExplorer (ilExplorer $localExplorer)
 Show cms explorer. More...
 
 dInitEditTree ()
 Init tree. More...
 
 dMap ()
 Do mapping. More...
 
 dMappingOverview ()
 Show directory trees. More...
 
 setTabs ()
 Set tabs. More...
 
 setSubTabs (int $a_tab)
 Set Sub tabs. More...
 

Protected Attributes

ilLogger $log
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 

Private Attributes

ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
ilECSSettingsGUI $container
 
ilECSSetting $server
 
int $mid
 

Detailed Description

Class for ECS node and directory mapping settings.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e @ilCtrl_isCalledBy ilECSMappingSettingsGUI: ilECSSettingsGUI

Definition at line 26 of file class.ilECSMappingSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSMappingSettingsGUI::__construct ( ilECSSettingsGUI  $settingsContainer,
int  $server_id,
int  $mid 
)

Constructor.

Definition at line 46 of file class.ilECSMappingSettingsGUI.php.

47 {
48 global $DIC;
49
50 $this->lng = $DIC->language();
51 $this->ctrl = $DIC->ctrl();
52 $this->tpl = $DIC->ui()->mainTemplate();
53 $this->log = $DIC->logger()->wsrv();
54 $this->tabs = $DIC->tabs();
55 $this->toolbar = $DIC->toolbar();
56
57 $this->container = $settingsContainer;
58 $this->server = ilECSSetting::getInstanceByServerId($server_id);
59 $this->mid = $mid;
60 $this->lng->loadLanguageModule('ecs');
61 }
static getInstanceByServerId(int $a_server_id)
Get singleton instance per server.
global $DIC
Definition: feed.php:28

References $DIC, $mid, ILIAS\Repository\ctrl(), ilECSSetting\getInstanceByServerId(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ cAddAttribute()

ilECSMappingSettingsGUI::cAddAttribute ( )
protected

Add one attribute in form.

Definition at line 200 of file class.ilECSMappingSettingsGUI.php.

200 : void
201 {
202 $next_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getNextAttributeName((string) $_REQUEST['ecs_ca']);
203 $this->cInitOverview(null, $next_attribute);
204 }
static getInstance(int $a_server_id, int $a_mid)
Get instance.
cInitOverview($form=null, $current_attribute=null)
Show overview page.

References cInitOverview(), ilECSCourseAttributes\getInstance(), getMid(), and getServer().

+ Here is the call graph for this function:

◆ cancel()

ilECSMappingSettingsGUI::cancel ( )

return to parent container

Definition at line 112 of file class.ilECSMappingSettingsGUI.php.

112 : void
113 {
114 $this->ctrl->returnToParent($this);
115 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cDeleteAttribute()

ilECSMappingSettingsGUI::cDeleteAttribute ( )
protected

Delete last attribute in form.

Definition at line 209 of file class.ilECSMappingSettingsGUI.php.

209 : void
210 {
211 $prev_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getPreviousAttributeName((string) $_REQUEST['ecs_ca']);
212 $this->cInitOverview(null, $prev_attribute);
213 }

References cInitOverview(), ilECSCourseAttributes\getInstance(), getMid(), and getServer().

+ Here is the call graph for this function:

◆ cDeleteRulesOfNode()

ilECSMappingSettingsGUI::cDeleteRulesOfNode ( )
protected

Definition at line 414 of file class.ilECSMappingSettingsGUI.php.

414 : void
415 {
416 $current_node = (int) $_REQUEST['lnodes'];
417
419 $this->getServer()->getServerId(),
420 $this->getMid(),
421 $current_node
422 );
423
424 foreach ($rules as $rid) {
425 $rule = new ilECSCourseMappingRule($rid);
426 $rule->delete();
427 }
428 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
429 $this->ctrl->redirect($this, 'cInitOverview');
430 }
static getRulesOfRefId(int $a_sid, int $a_mid, int $a_ref_id)
Get all rule of ref_id.

References ILIAS\Repository\ctrl(), getMid(), ilECSCourseMappingRule\getRulesOfRefId(), getServer(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ cInitMappingForm()

ilECSMappingSettingsGUI::cInitMappingForm ( int  $current_node,
  $current_attribute 
)
protected

Init the mapping form.

Definition at line 249 of file class.ilECSMappingSettingsGUI.php.

250 {
251 $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
252
253 $form = new ilPropertyFormGUI();
254 $form->setTableWidth("100%");
255 $this->ctrl->setParameter($this, 'ecs_ca', $current_attribute);
256 $form->setFormAction($this->ctrl->getFormAction($this));
257 $this->ctrl->setParameter($this, 'ecs_ca', '');
258
259 $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') . ' ' . ilObject::_lookupTitle(ilObject::_lookupObjId($current_node)));
260
261 // Iterate through all current attributes
262 $attributes = $attributes_obj->getAttributeSequence($current_attribute);
263 foreach ($attributes as $att_name) {
264 $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name);
265
266 $section = new ilFormSectionHeaderGUI();
267 $section->setTitle($this->lng->txt('ecs_cmap_att_' . $att_name));
268
269 // Filter
270 $form->addItem($section);
271
272 $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'), $att_name . '_is_filter');
273 $isfilter->setValue($rule->isFilterEnabled() ? "1" : "0");
274
275 $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'), "0");
276 $isfilter->addOption($all_values);
277
278 $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'), "1");
279 $filter = new ilTextInputGUI('', $att_name . '_filter');
280 $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info'));
281 $filter->setSize(50);
282 $filter->setMaxLength(512);
283 $filter->setRequired(true);
284 $filter->setValue($rule->getFilter());
285 $use_filter->addSubItem($filter);
286
287 $isfilter->addOption($use_filter);
288
289 $form->addItem($isfilter);
290
291 // Create subdirs
292 $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'), $att_name . '_subdirs');
293 $subdirs->setChecked($rule->isSubdirCreationEnabled());
294 $subdirs->setValue("1");
295
296 // Subdir types (disabled in spec)
297 /*
298 $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type');
299 $subdir_type->setValue($rule->getSubDirectoryType());
300
301 $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'), ilECSCourseMappingRule::SUBDIR_VALUE);
302 $subdir_type->addOption($value);
303
304 $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'), ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME);
305 $subdir_type->addOption($name);
306
307 $subdirs->addSubItem($subdir_type);
308 */
309 $form->addItem($subdirs);
310
311 // Directory relations
312 /*
313 $upper_attributes = ilECSCourseAttributes::getInstance(
314 $this->getServer()->getServerId(),
315 $this->getMid())->getUpperAttributes($att_name);
316
317 if($upper_attributes)
318 {
319 $dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation');
320
321 $current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),'');
322 $dir_relation->addOption($current_dir);
323 }
324 foreach($upper_attributes as $subdir_name)
325 {
326 $subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name);
327 $dir_relation->addOption($subdir);
328 }
329 if($upper_attributes)
330 {
331 $dir_relation->setValue((string) $rule->getDirectory());
332 $form->addItem($dir_relation);
333 }
334 */
335 }
336
337 // add list of attributes
338 $hidden_atts = new ilHiddenInputGUI('attributes');
339 $hidden_atts->setValue(implode(',', $attributes));
340 $form->addItem($hidden_atts);
341
342
343 if ($current_attribute) {
344 $form->addCommandButton('cSaveOverview', $this->lng->txt('save'));
345 }
346
347 if ($attributes_obj->getNextAttributeName($current_attribute)) {
348 $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn'));
349 }
350 if ($attributes_obj->getPreviousAttributeName($current_attribute)) {
351 $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn'));
352 }
354 $this->getServer()->getServerId(),
355 $this->getMid(),
356 $current_node
357 )) {
358 $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule'));
359 }
360
361 #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel'));
362
363 $form->setShowTopButtons(false);
364
365 return $form;
366 }
This class represents a checkbox property in a property form.
static hasRules(int $a_sid, int $a_mid, int $a_ref_id)
static getInstanceByAttribute($a_sid, $a_mid, $a_ref_id, $a_att)
Get rule instance by attribute.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
$attributes
Definition: metadata.php:248

References $attributes, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), ilECSCourseAttributes\getInstance(), ilECSCourseMappingRule\getInstanceByAttribute(), getMid(), getServer(), ilECSCourseMappingRule\hasRules(), and ILIAS\Repository\lng().

Referenced by cInitOverview(), and cSaveOverview().

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

◆ cInitOverview()

ilECSMappingSettingsGUI::cInitOverview (   $form = null,
  $current_attribute = null 
)
protected

Show overview page.

Definition at line 152 of file class.ilECSMappingSettingsGUI.php.

152 : void
153 {
154 $current_node = (array) (($_REQUEST['lnodes']) ?: ROOT_FOLDER_ID);
155 //TODO fix proper handling of input
156 $current_node = (int) end($current_node);
157
158 $this->ctrl->setParameter($this, 'lnodes', $current_node);
159
160 $this->setSubTabs(self::TAB_COURSE);
161 $this->tabs->activateTab('ecs_crs_allocation');
162 $this->tabs->activateSubTab('cInitTree');
163
164 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ecs_cmap_overview.html', 'Services/WebServices/ECS');
165
166 $explorer = $this->cShowLocalExplorer();
167 if (!$form instanceof ilPropertyFormGUI) {
168 if ($current_attribute === null) {
169 // check request
170 $current_attribute = (string) $_REQUEST['ecs_ca'];
171 if (!$current_attribute) {
173 $this->getServer()->getServerId(),
174 $this->getMid(),
175 $current_node
176 );
177
178 $current_attribute =
179 $existing ?:
180 '';
181 /*
182 ilECSCourseAttributes::getInstance(
183 $this->getServer()->getServerId(),
184 $this->getMid())->getFirstAttributeName()
185 );
186 */
187 }
188 }
189 $form = $this->cInitMappingForm($current_node, $current_attribute);
190 }
191
192 $this->tpl->setVariable('TFORM_ACTION', $this->ctrl->getFormAction($this));
193 $this->tpl->setVariable('LOCAL_EXPLORER', $explorer->getOutput());
194 $this->tpl->setVariable('MAPPING_FORM', $form->getHTML());
195 }
static lookupLastExistingAttribute(int $a_sid, int $a_mid, int $a_ref_id)
Lookup existing attributes.
cInitMappingForm(int $current_node, $current_attribute)
Init the mapping form.
const ROOT_FOLDER_ID
Definition: constants.php:32

References cInitMappingForm(), cShowLocalExplorer(), ILIAS\Repository\ctrl(), getMid(), getServer(), ILIAS\Repository\int(), ilECSCourseMappingRule\lookupLastExistingAttribute(), ROOT_FOLDER_ID, setSubTabs(), and ILIAS\Repository\tabs().

Referenced by cAddAttribute(), cDeleteAttribute(), cSaveOverview(), and cStart().

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

◆ cSaveOverview()

ilECSMappingSettingsGUI::cSaveOverview ( )
protected

Save overview.

Definition at line 371 of file class.ilECSMappingSettingsGUI.php.

371 : void
372 {
373 $current_node = (int) $_REQUEST['lnodes'];
374 $current_att = (string) $_REQUEST['ecs_ca'];
375 $form = $this->cInitMappingForm($current_node, $current_att);
376
377 if ($form->checkInput()) {
378 // save ...
379 $all_attributes = explode(',', $form->getInput('attributes'));
380 foreach ((array) $all_attributes as $att_name) {
382 $this->getServer()->getServerId(),
383 $this->getMid(),
384 $current_node,
385 $att_name
386 );
387 $rule->setServerId($this->getServer()->getServerId());
388 $rule->setMid($this->getMid());
389 $rule->setRefId($current_node);
390 $rule->setAttribute($att_name);
391 $rule->enableFilter((bool) $form->getInput($att_name . '_is_filter'));
392 $rule->setFilter($form->getInput($att_name . '_filter'));
393 $rule->enableSubdirCreation((bool) $form->getInput($att_name . '_subdirs'));
394 //$rule->setSubDirectoryType($form->getInput($att_name.'_subdir_type'));
395 //$rule->setDirectory($form->getInput($att_name.'_dir_relation'));
396
397 if ($rule->getRuleId()) {
398 $rule->update();
399 } else {
400 $rule->save();
401 }
402 }
403
404 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
405 $this->ctrl->setParameter($this, 'lnodes', $current_node);
406 $this->ctrl->redirect($this, 'cInitOverview');
407 }
408
409 $form->setValuesByPost();
410 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
411 $this->cInitOverview($form, $current_att);
412 }

References cInitMappingForm(), cInitOverview(), ILIAS\Repository\ctrl(), ilECSCourseMappingRule\getInstanceByAttribute(), getMid(), getServer(), ILIAS\Repository\int(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ cSettings()

ilECSMappingSettingsGUI::cSettings ( ilPropertyFormGUI  $form = null)
protected

Show course allocation.

Definition at line 438 of file class.ilECSMappingSettingsGUI.php.

438 : bool
439 {
440 $this->setSubTabs(self::TAB_COURSE);
441 $this->tabs->activateTab('ecs_crs_allocation');
442 $this->tabs->activateSubTab('cSettings');
443
444 if (!$form instanceof ilPropertyFormGUI) {
445 $form = $this->initFormCSettings();
446 }
447
448 $this->tpl->setContent($form->getHTML());
449
450 return true;
451 }

References initFormCSettings(), setSubTabs(), and ILIAS\Repository\tabs().

Referenced by cStart(), and cUpdateSettings().

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

◆ cShowLocalExplorer()

ilECSMappingSettingsGUI::cShowLocalExplorer ( )
protected

Show local explorer.

Definition at line 218 of file class.ilECSMappingSettingsGUI.php.

219 {
220 $explorer = new ilECSNodeMappingLocalExplorer(
221 $this->ctrl->getLinkTarget($this, 'cInitOverview'),
222 $this->getServer()->getServerId(),
223 $this->getMid()
224 );
225 $explorer->setPostVar('lnodes[]');
226
227 $lnodes = (array) $_REQUEST['lnodes'];
228 $checked_node = (int) array_pop($lnodes);
229 if ((int) $_REQUEST['lid']) {
230 $checked_node = (int) $_REQUEST['lid'];
231 }
232
233 if ($checked_node) {
234 $explorer->setCheckedItems(array($checked_node));
235 } else {
236 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
237 }
238 $explorer->setTargetGet('lref_id');
239 $explorer->setSessionExpandVariable('lexpand');
240 $explorer->setExpand((int) $_GET['lexpand']);
241 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'cInitOverview'));
242 $explorer->setOutput(0);
243 return $explorer;
244 }
$_GET['client_id']
Definition: saml1-acs.php:21

References $_GET, ILIAS\Repository\ctrl(), ILIAS\Repository\int(), and ROOT_FOLDER_ID.

Referenced by cInitOverview().

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

◆ cStart()

ilECSMappingSettingsGUI::cStart ( )
protected

Goto default page.

Definition at line 125 of file class.ilECSMappingSettingsGUI.php.

125 : void
126 {
128 $this->getServer()->getServerId(),
129 $this->getMid()
130 )->isCourseAllocationEnabled()) {
131 $this->cInitOverview();
132 } else {
133 $this->cSettings();
134 }
135 }
cSettings(ilPropertyFormGUI $form=null)
Show course allocation.
static getInstanceByServerMid(int $a_server_id, int $a_mid)
Get instance.

References cInitOverview(), cSettings(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), and getServer().

+ Here is the call graph for this function:

◆ cUpdateSettings()

ilECSMappingSettingsGUI::cUpdateSettings ( )
protected

Update course settings.

Definition at line 588 of file class.ilECSMappingSettingsGUI.php.

588 : void
589 {
590 $form = $this->initFormCSettings();
591 if ($form->checkInput()) {
593 $settings->enableCourseAllocation((bool) $form->getInput('enabled'));
594 $settings->setDefaultCourseCategory((int) $form->getInput('default_cat'));
595 $settings->enableAllInOne((bool) $form->getInput('allinone'));
596 $settings->setAllInOneCategory((int) $form->getInput('allinone_cat'));
597 $settings->enableAttributeMapping((bool) $form->getInput('multiple'));
598 $settings->setAuthMode($form->getInput('auth_mode'));
599
600 $role_mappings = [];
601 foreach (ilECSMappingUtils::getRoleMappingInfo() as $role => $name) {
602 $role_mappings[$role] = $form->getInput((string) $role);
603 }
604 $settings->setRoleMappings($role_mappings);
605 $settings->update();
606
607 // store attribute settings
608 $attributes = new ilECSCourseAttributes($this->getServer()->getServerId(), $this->getMid());
609 $attributes->delete();
610
611 $form_atts = $form->getInput('atts');
612
613 foreach ($form_atts as $name) {
614 if (!$name) {
615 continue;
616 }
617
618 $att = new ilECSCourseAttribute();
619 $att->setServerId($this->getServer()->getServerId());
620 $att->setMid($this->getMid());
621 $att->setName($name);
622 $att->save();
623 }
624
625 //$att = new ilECSCourseAttribute();
626 //$att->setName($a_name)
627
628 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
629 $this->ctrl->redirect($this, 'cSettings');
630 }
631 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
632 $form->setValuesByPost();
633 $this->cSettings($form);
634 }
Storage of course attributes for assignment rules.
Storage of course attributes for assignment rules.
static getRoleMappingInfo($a_role_type_info=0)
Get role mapping info.
if($format !==null) $name
Definition: metadata.php:247
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References $attributes, $name, ILIAS\LTI\ToolProvider\$settings, cSettings(), ILIAS\Repository\ctrl(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), ilECSMappingUtils\getRoleMappingInfo(), getServer(), initFormCSettings(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ dConfirmDeleteTree()

ilECSMappingSettingsGUI::dConfirmDeleteTree ( )
protected

Delete tree settings.

Definition at line 709 of file class.ilECSMappingSettingsGUI.php.

709 : void
710 {
711 $this->setSubTabs(self::TAB_DIRECTORY);
712 $this->tabs->activateSubTab('dTrees');
713 $this->tabs->activateTab('ecs_dir_allocation');
714
715 $confirm = new ilConfirmationGUI();
716 $confirm->setFormAction($this->ctrl->getFormAction($this));
717 $confirm->setHeaderText($this->lng->txt('ecs_confirm_delete_tree'));
718
719 $confirm->addItem(
720 'tid',
721 $_REQUEST['tid'],
723 $this->getServer()->getServerId(),
724 $this->getMid(),
725 (int) $_REQUEST['tid']
726 )
727 );
728 $confirm->setConfirm($this->lng->txt('delete'), 'dDeleteTree');
729 $confirm->setCancel($this->lng->txt('cancel'), 'dTrees');
730
731 $this->tpl->setContent($confirm->getHTML());
732 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupTitle(int $a_server_id, int $a_mid, int $a_tree_id)
Lookup title by obj id.

References ILIAS\Repository\ctrl(), getMid(), getServer(), ILIAS\Repository\lng(), ilECSCmsData\lookupTitle(), setSubTabs(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ dDeleteTree()

ilECSMappingSettingsGUI::dDeleteTree ( )
protected

Delete tree.

Definition at line 737 of file class.ilECSMappingSettingsGUI.php.

737 : void
738 {
739 $this->log->info('Deleting tree');
740
741 $tree = new ilECSCmsTree((int) $_REQUEST['tid']);
742 $tree->deleteTree($tree->getNodeData(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
743
744
745
746 // also delete import information
747 ilECSImportManager::getInstance()->deleteRessources(
748 $this->getServer()->getServerId(),
749 $this->getMid(),
751 $this->getServer()->getServerId(),
752 $this->getMid(),
753 (int) $_REQUEST['tid']
754 )
755 );
756
757 $data = new ilECSCmsData();
758 $data->setServerId($this->getServer()->getServerId());
759 $data->setMid($this->getMid());
760 $data->setTreeId((int) $_REQUEST['tid']);
761 $data->deleteTree();
762
764 $this->getServer()->getServerId(),
765 $this->getMid(),
766 (int) $_REQUEST['tid']
767 );
768
769 $this->tpl->setOnScreenMessage('success', $this->lng->txt('ecs_cms_tree_deleted'), true);
770 $this->ctrl->redirect($this, 'dTrees');
771 }
static lookupCmsIdsOfTree($a_server_id, $a_mid, $a_tree_id)
static lookupRootId($a_tree_id)
lookup root id
static getInstance()
Get the singleton instance of this ilECSImportManager.
static deleteMappings(int $a_server_id, int $a_mid, int $a_tree_id)
Delete mappings.

References $data, ILIAS\Repository\ctrl(), ilECSNodeMappingAssignments\deleteMappings(), ilECSImportManager\getInstance(), getMid(), getServer(), ILIAS\Repository\lng(), ilECSCmsData\lookupCmsIdsOfTree(), and ilECSCmsTree\lookupRootId().

+ Here is the call graph for this function:

◆ dEditTree()

ilECSMappingSettingsGUI::dEditTree ( ilPropertyFormGUI  $form = null)
protected

Edit directory tree assignments.

Definition at line 776 of file class.ilECSMappingSettingsGUI.php.

776 : void
777 {
778 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ecs_edit_tree.html', 'Services/WebServices/ECS');
779
780 $this->ctrl->saveParameter($this, 'cid');
781
782 $this->tabs->clearTargets();
783 $this->tabs->setBack2Target(
784 $this->lng->txt('ecs_back_settings'),
785 $this->ctrl->getLinkTarget($this, 'cancel')
786 );
787 $this->tabs->setBackTarget(
788 $this->lng->txt('ecs_cms_dir_tree'),
789 $this->ctrl->getLinkTarget($this, 'dTrees')
790 );
791
792 $this->tpl->setVariable('LEGEND', $this->lng->txt('ecs_status_legend'));
793 $this->tpl->setVariable('PENDING_UNMAPPED', $this->lng->txt('ecs_status_pending_unmapped'));
794 $this->tpl->setVariable('PENDING_UNMAPPED_DISCON', $this->lng->txt('ecs_status_pending_unmapped_discon'));
795 $this->tpl->setVariable('PENDING_UNMAPPED_NONDISCON', $this->lng->txt('ecs_status_pending_unmapped_nondiscon'));
796 $this->tpl->setVariable('MAPPED', $this->lng->txt('ecs_status_mapped'));
797 $this->tpl->setVariable('DELETED', $this->lng->txt('ecs_status_deleted'));
798
799 $form = $this->dInitFormTreeSettings($form);
800 $this->tpl->setVariable('GENERAL_FORM', $form->getHTML());
801 $this->tpl->setVariable('TFORM_ACTION', $this->ctrl->getFormAction($this, 'dEditTree'));
802
803 $explorer = $this->dShowLocalExplorer();
804 $this->dShowCmsExplorer($explorer);
805 }
dShowCmsExplorer(ilExplorer $localExplorer)
Show cms explorer.
dInitFormTreeSettings(ilPropertyFormGUI $form=null)
Init form settings.

References ILIAS\Repository\ctrl(), dInitFormTreeSettings(), dShowCmsExplorer(), dShowLocalExplorer(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by dInitEditTree(), and dUpdateTreeSettings().

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

◆ dInitEditTree()

ilECSMappingSettingsGUI::dInitEditTree ( )
protected

Init tree.

Definition at line 1043 of file class.ilECSMappingSettingsGUI.php.

1043 : void
1044 {
1046 $this->getServer()->getServerId(),
1047 $this->getMid(),
1048 (int) $_REQUEST['tid']
1049 );
1050 $this->dEditTree();
1051 }
static updateStatus(int $a_server_id, int $a_mid, int $a_tree_id)
dEditTree(ilPropertyFormGUI $form=null)
Edit directory tree assignments.

References dEditTree(), getMid(), getServer(), and ilECSCmsData\updateStatus().

+ Here is the call graph for this function:

◆ dInitFormTreeSettings()

ilECSMappingSettingsGUI::dInitFormTreeSettings ( ilPropertyFormGUI  $form = null)
protected

Init form settings.

Definition at line 810 of file class.ilECSMappingSettingsGUI.php.

811 {
812 if ($form instanceof ilPropertyFormGUI) {
813 return $form;
814 }
815
816 $assignment = new ilECSNodeMappingAssignment(
817 $this->getServer()->getServerId(),
818 $this->getMid(),
819 (int) $_REQUEST['tid'],
820 0
821 );
822
823 $form = new ilPropertyFormGUI();
824 $form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree'));
825 $form->setTitle($this->lng->txt('general_settings'));
826 $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
827 $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
828 $form->setTableWidth('30%');
829
830 // CMS id (readonly)
831 $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
832 $cmsid->setValue(
834 );
835 $cmsid->setDisabled(true);
836 $cmsid->setSize(7);
837 $cmsid->setMaxLength(12);
838 $form->addItem($cmsid);
839
840
842 $this->getServer()->getServerId(),
843 $this->getMid(),
844 (int) $_REQUEST['tid']
845 );
846 $mapping_advanced = ($mapping_status !== ilECSMappingUtils::MAPPED_MANUAL);
847
848 // Status (readonly)
849 $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
850 $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
851 $form->addItem($status);
852
853 // title update
854 $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
855 $title->setValue("1");
856 $title->setChecked($assignment->isTitleUpdateEnabled());
857 #$title->setInfo($this->lng->txt('ecs_title_update_info'));
858 $form->addItem($title);
859
860
861 $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
862 $position->setDisabled(!$mapping_advanced);
863 $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
864 $position->setValue("1");
865 #$position->setInfo($this->lng->txt('ecs_position_update_info'));
866 $form->addItem($position);
867
868 $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
869 $tree->setDisabled(!$mapping_advanced);
870 $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
871 $tree->setValue("1");
872 #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
873 $form->addItem($tree);
874
875 return $form;
876 }
static lookupCmsId($a_obj_id)
Lookup cms id.
static mappingStatusToString(int $a_status)
Get mapping status as string.
static lookupMappingStatus(int $a_server_id, int $a_mid, int $a_tree_id)
Lookup mapping status.
setFormAction(string $a_formaction)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a number property in a property form.
setTableWidth(string $a_width)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")

References ILIAS\Repository\ctrl(), getMid(), getServer(), ILIAS\Repository\lng(), ilECSCmsData\lookupCmsId(), ilECSMappingUtils\lookupMappingStatus(), ilECSCmsTree\lookupRootId(), ilECSMappingUtils\MAPPED_MANUAL, and ilECSMappingUtils\mappingStatusToString().

Referenced by dEditTree(), and dUpdateTreeSettings().

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

◆ dMap()

ilECSMappingSettingsGUI::dMap ( )
protected

Do mapping.

Definition at line 1057 of file class.ilECSMappingSettingsGUI.php.

1057 : void
1058 {
1059 if (!$_POST['lnodes']) {
1060 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1061 $this->ctrl->redirect($this, 'dEditTree');
1062 }
1063
1064 $ref_id = end($_POST['lnodes']);
1065
1067 $this->getServer()->getServerId(),
1068 $this->getMid(),
1069 (int) $_REQUEST['tid'],
1070 $ref_id
1071 );
1072
1073
1074 $nodes = (array) $_POST['rnodes'];
1075 $nodes = array_reverse($nodes);
1076
1077 foreach ($nodes as $cms_id) {
1078 $assignment = new ilECSNodeMappingAssignment(
1079 $this->getServer()->getServerId(),
1080 $this->getMid(),
1081 (int) $_REQUEST['tid'],
1082 (int) $cms_id
1083 );
1084 $assignment->setRefId($ref_id);
1085 $assignment->setObjId(ilObject::_lookupObjId($ref_id));
1086 $assignment->enablePositionUpdate(false);
1087 $assignment->enableTreeUpdate(false);
1088 $assignment->enableTitleUpdate(ilECSNodeMappingAssignments::lookupDefaultTitleUpdate(
1089 $this->getServer()->getServerId(),
1090 $this->getMid(),
1091 (int) $_REQUEST['tid']
1092 ));
1093 $assignment->update();
1094
1095 // Delete subitems mappings for cms subtree
1096 $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1097 $childs = $cmsTree->getSubTreeIds($cms_id);
1098
1100 $this->getServer()->getServerId(),
1101 $this->getMid(),
1102 (int) $_REQUEST['tid'],
1103 $childs
1104 );
1105 }
1106
1108 $this->getServer()->getServerId(),
1109 $this->getMid(),
1110 (int) $_REQUEST['tid']
1111 );
1112
1113 // Save parameter cid
1114 $this->ctrl->setParameter($this, 'lid', (int) $ref_id);
1115
1116 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1117 $this->ctrl->redirect($this, 'dEditTree');
1118 }
static deleteDisconnectableMappings(int $a_server_id, int $a_mid, int $a_tree_id, int $a_ref_id)
delete disconnectable mappings
static lookupDefaultTitleUpdate($a_server_id, $a_mid, $a_tree_id)
Lookup default title update setting.
static deleteMappingsByCsId(int $a_server_id, int $a_mid, int $a_tree_id, array $cs_ids)
Delete mappings.
$ref_id
Definition: ltiauth.php:67

References $ref_id, ilObject\_lookupObjId(), ILIAS\Repository\ctrl(), ilECSNodeMappingAssignments\deleteDisconnectableMappings(), ilECSNodeMappingAssignments\deleteMappingsByCsId(), getMid(), getServer(), ILIAS\Repository\lng(), ilECSNodeMappingAssignments\lookupDefaultTitleUpdate(), and ilECSCmsData\updateStatus().

+ Here is the call graph for this function:

◆ dMappingOverview()

ilECSMappingSettingsGUI::dMappingOverview ( )
protected

Show directory trees.

Definition at line 1123 of file class.ilECSMappingSettingsGUI.php.

1123 : void
1124 {
1125 $this->setSubTabs(self::TAB_DIRECTORY);
1126 $this->tabs->activateSubTab('dMappingOverview');
1127 $this->tabs->activateTab('ecs_dir_allocation');
1128 }

References setSubTabs(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ dSettings()

ilECSMappingSettingsGUI::dSettings ( ilPropertyFormGUI  $form = null)
protected

Show directory allocation.

Definition at line 570 of file class.ilECSMappingSettingsGUI.php.

570 : bool
571 {
572 $this->setSubTabs(self::TAB_DIRECTORY);
573 $this->tabs->activateTab('ecs_dir_allocation');
574 $this->tabs->activateSubTab('dSettings');
575
576 if (!$form instanceof ilPropertyFormGUI) {
577 $form = $this->initFormDSettings();
578 }
579
580 $this->tpl->setContent($form->getHTML());
581
582 return true;
583 }

References initFormDSettings(), setSubTabs(), and ILIAS\Repository\tabs().

Referenced by dStart().

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

◆ dShowCmsExplorer()

ilECSMappingSettingsGUI::dShowCmsExplorer ( ilExplorer  $localExplorer)
protected

Show cms explorer.

Definition at line 986 of file class.ilECSMappingSettingsGUI.php.

986 : void
987 {
988 $explorer = new ilECSNodeMappingCmsExplorer(
989 $this->ctrl->getLinkTarget($this, 'dEditTree'),
990 $this->getServer()->getServerId(),
991 $this->getMid(),
992 (int) $_REQUEST['tid']
993 );
994 $explorer->setRoot(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid']));
995 $explorer->setTree(
996 new ilECSCmsTree(
997 (int) $_REQUEST['tid']
998 )
999 );
1000 $explorer->setPostVar('rnodes[]');
1001
1002 // Read checked items from mapping of checked items in local explorer
1003 // $active_node = $this->tree->getRootId();
1004 foreach ($localExplorer->getCheckedItems() as $ref_id) {
1005 $explorer->setCheckedItems(
1007 $this->getServer()->getServerId(),
1008 $this->getMid(),
1009 (int) $_REQUEST['tid'],
1010 $ref_id
1011 )
1012 );
1013 // $active_node = $ref_id;
1014 }
1015
1016 // $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1017 // foreach (ilECSNodeMappingAssignments::lookupAssignmentsByRefId(
1018 // $this->getServer()->getServerId(),
1019 // $this->getMid(),
1020 // (int) $_REQUEST['tid'],
1021 // $active_node
1022 // ) as $cs_id) {
1023 // foreach ($cmsTree->getPathId($cs_id) as $path_id) {
1024 // #$explorer->setExpand($path_id);
1025 // }
1026 // }
1027
1028 $explorer->setTargetGet('rref_id');
1029 $explorer->setSessionExpandVariable('rexpand');
1030
1031 #if((int) $_REQUEST['rexpand'])
1032 {
1033 $explorer->setExpand((int) $_GET['rexpand']);
1034 }
1035 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'dEditTree'));
1036 $explorer->setOutput(0);
1037 $this->tpl->setVariable('REMOTE_EXPLORER', $explorer->getOutput());
1038 }
static lookupMappedItemsForRefId(int $a_server_id, int $a_mid, int $a_tree_id, int $a_ref_id)
Get cs ids for ref_id.

References $_GET, $ref_id, ILIAS\Repository\ctrl(), getMid(), getServer(), ilECSNodeMappingAssignments\lookupMappedItemsForRefId(), and ilECSCmsTree\lookupRootId().

Referenced by dEditTree().

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

◆ dShowLocalExplorer()

ilECSMappingSettingsGUI::dShowLocalExplorer ( )
protected

Show local explorer.

Definition at line 953 of file class.ilECSMappingSettingsGUI.php.

954 {
955 $explorer = new ilECSNodeMappingLocalExplorer(
956 $this->ctrl->getLinkTarget($this, 'dEditTree'),
957 $this->getServer()->getServerId(),
958 $this->getMid()
959 );
960 $explorer->setPostVar('lnodes[]');
961
962 $lnodes = (array) $_REQUEST['lnodes'];
963 $checked_node = array_pop($lnodes);
964 if ((int) $_REQUEST['lid']) {
965 $checked_node = (int) $_REQUEST['lid'];
966 }
967
968 if ($checked_node) {
969 $explorer->setCheckedItems(array($checked_node));
970 } else {
971 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
972 }
973 $explorer->setTargetGet('lref_id');
974 $explorer->setSessionExpandVariable('lexpand');
975 $explorer->setExpand((int) $_GET['lexpand']);
976 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'dEditTree'));
977 $explorer->setOutput(0);
978 $this->tpl->setVariable('LOCAL_EXPLORER', $explorer->getOutput());
979
980 return $explorer;
981 }

References $_GET, ILIAS\Repository\ctrl(), ILIAS\Repository\int(), and ROOT_FOLDER_ID.

Referenced by dEditTree().

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

◆ dStart()

ilECSMappingSettingsGUI::dStart ( )
protected

Goto default page.

Definition at line 140 of file class.ilECSMappingSettingsGUI.php.

140 : void
141 {
142 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled()) {
143 $this->dTrees();
144 } else {
145 $this->dSettings();
146 }
147 }
dSettings(ilPropertyFormGUI $form=null)
Show directory allocation.

References dSettings(), dTrees(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), and getServer().

+ Here is the call graph for this function:

◆ dSynchronizeTree()

ilECSMappingSettingsGUI::dSynchronizeTree ( )
protected

Synchronize Tree.

Definition at line 913 of file class.ilECSMappingSettingsGUI.php.

913 : void
914 {
915 $sync = new ilECSCmsTreeSynchronizer(
916 $this->getServer(),
917 $this->mid,
918 (int) $_REQUEST['tid']
919 );
920 $sync->sync();
921 $this->tpl->setOnScreenMessage('success', $this->lng->txt('ecs_cms_tree_synchronized'), true);
922 $this->ctrl->redirect($this, 'dTrees');
923 }

References ILIAS\Repository\ctrl(), getServer(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ dSynchronizeTrees()

ilECSMappingSettingsGUI::dSynchronizeTrees ( )
protected

Definition at line 925 of file class.ilECSMappingSettingsGUI.php.

925 : void
926 {
927 $this->log->dump('Start synchronizing cms directory trees');
928
929 try {
930 $connector = new ilECSDirectoryTreeConnector($this->getServer());
931 $res = $connector->getDirectoryTrees();
932
933 $this->log->dump($res, ilLogLevel::DEBUG);
934
935 foreach ($res->getLinkIds() as $cms_id) {
936 $event = new ilECSEventQueueReader($this->getServer());
937 $event->add(
939 $cms_id,
941 );
942 }
943 $this->ctrl->redirect($this, 'dTrees');
944 } catch (Exception $e) {
945 $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
946 $this->ctrl->redirect($this, 'dTrees');
947 }
948 }
Reads ECS events and stores them in the database.
$res
Definition: ltiservices.php:69

References Vendor\Package\$e, $res, ILIAS\Repository\ctrl(), ilLogLevel\DEBUG, getServer(), ilECSEventQueueReader\TYPE_DIRECTORY_TREES, and ilECSEvent\UPDATED.

+ Here is the call graph for this function:

◆ dTrees()

ilECSMappingSettingsGUI::dTrees ( )
protected

Show directory trees.

Definition at line 682 of file class.ilECSMappingSettingsGUI.php.

682 : bool
683 {
684 $this->setSubTabs(self::TAB_DIRECTORY);
685 $this->tabs->activateSubTab('dTrees');
686 $this->tabs->activateTab('ecs_dir_allocation');
687
688 $this->toolbar->addButton(
689 $this->lng->txt('ecs_sync_trees'),
690 $this->ctrl->getLinkTarget($this, 'dSynchronizeTrees')
691 );
692
693 $dtreeTable = new ilECSNodeMappingTreeTableGUI(
694 $this->getServer()->getServerId(),
695 $this->getMid(),
696 $this,
697 'dtree'
698 );
699
700
701 $dtreeTable->parse();
702 $this->tpl->setContent($dtreeTable->getHTML());
703 return true;
704 }

References getMid(), getServer(), ILIAS\Repository\lng(), setSubTabs(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

Referenced by dStart().

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

◆ dUpdateSettings()

ilECSMappingSettingsGUI::dUpdateSettings ( )
protected

Update node mapping settings.

Definition at line 639 of file class.ilECSMappingSettingsGUI.php.

639 : void
640 {
641 $form = $this->initFormDSettings();
642 if ($form->checkInput()) {
644 $settings->enableDirectoryMapping((bool) $form->getInput('active'));
645 $settings->enableEmptyContainerCreation(!$form->getInput('empty'));
646 $settings->update();
647 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
648 } else {
649 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'), true);
650 $form->setValuesByPost();
651 }
652 $this->ctrl->redirect($this, 'dSettings');
653 }

References ILIAS\LTI\ToolProvider\$settings, ILIAS\Repository\ctrl(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), getServer(), initFormDSettings(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ dUpdateTreeSettings()

ilECSMappingSettingsGUI::dUpdateTreeSettings ( )
protected
Returns
boolean Update global settings

Definition at line 882 of file class.ilECSMappingSettingsGUI.php.

882 : bool
883 {
884 $assignment = new ilECSNodeMappingAssignment(
885 $this->getServer()->getServerId(),
886 $this->getMid(),
887 (int) $_REQUEST['tid'],
888 0
889 );
890 $assignment->setRefId(0);
891 $assignment->setObjId(0);
892
893 $form = $this->dInitFormTreeSettings();
894 if ($form->checkInput()) {
895 $assignment->enableTitleUpdate($form->getInput('title'));
896 $assignment->enableTreeUpdate($form->getInput('tree'));
897 $assignment->enablePositionUpdate($form->getInput('position'));
898 $assignment->update();
899
900 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved', "1"));
901 $this->ctrl->redirect($this, 'dEditTree');
902 }
903
904 $form->setValuesByPost();
905 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
906 $this->dEditTree($form);
907 return true;
908 }

References ILIAS\Repository\ctrl(), dEditTree(), dInitFormTreeSettings(), getMid(), getServer(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilECSMappingSettingsGUI::executeCommand ( )

ilCtrl executeCommand

Definition at line 88 of file class.ilECSMappingSettingsGUI.php.

88 : void
89 {
90 $this->tpl->setTitle($this->lng->txt('ecs_campus_connect_title'));
91
92 $this->ctrl->saveParameter($this, 'server_id');
93 $this->ctrl->saveParameter($this, 'mid');
94 $this->ctrl->saveParameter($this, 'tid');
95
96 $next_class = $this->ctrl->getNextClass($this);
97 $cmd = $this->ctrl->getCmd();
98
99 $this->setTabs();
100 if (!$cmd) {
101 $cmd = "cStart";
102 }
103 $this->$cmd();
104
105 $this->tpl->setTitle($this->getServer()->getTitle());
106 $this->tpl->setDescription('');
107 }

References ILIAS\Repository\ctrl(), getServer(), ILIAS\Repository\lng(), and setTabs().

+ Here is the call graph for this function:

◆ getContainer()

ilECSMappingSettingsGUI::getContainer ( )

Get container object.

Definition at line 66 of file class.ilECSMappingSettingsGUI.php.

References $container.

◆ getMid()

◆ getServer()

◆ initFormCSettings()

ilECSMappingSettingsGUI::initFormCSettings ( )
protected

Init settings form.

Definition at line 456 of file class.ilECSMappingSettingsGUI.php.

457 {
458 $form = new ilPropertyFormGUI();
459 $form->setFormAction($this->ctrl->getFormAction($this));
460 $form->setTitle($this->lng->txt('settings'));
461
462 // individual course allocation
463 $check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled');
464 $check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled());
465 $form->addItem($check);
466
467
468 // add default container
469 $imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'), 'default_cat');
470 $imp->setRequired(true);
471
472 $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
473 $tpl->setVariable('SIZE', 5);
474 $tpl->setVariable('MAXLENGTH', 11);
475 $tpl->setVariable('POST_VAR', 'default_cat');
476
477 $default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getDefaultCourseCategory();
478 $tpl->setVariable('PROPERTY_VALUE', $default);
479
480 if ($default) {
481 $path = new ilPathGUI();
482 $path->enableTextOnly(false);
483 $path->enableHideLeaf(false);
484 $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
485 }
486
487 $imp->setHtml($tpl->get());
488 $imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info'));
489 $form->addItem($imp);
490
491 // all in one category
492 $allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'), 'allinone');
493 $allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAllInOneCategoryEnabled());
494 $allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info'));
495
496 $allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'), 'allinone_cat');
497 $allinone_cat->setRequired(true);
498
499 $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
500 $tpl->setVariable('SIZE', 5);
501 $tpl->setVariable('MAXLENGTH', 11);
502 $tpl->setVariable('POST_VAR', 'allinone_cat');
503
504 $cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAllInOneCategory();
505 $tpl->setVariable('PROPERTY_VALUE', $cat);
506 if ($cat) {
507 $path = new ilPathGUI();
508 $path->enableTextOnly(false);
509 $path->enableHideLeaf(false);
510 $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
511 }
512
513 $allinone_cat->setHtml($tpl->get());
514 $allinone->addSubItem($allinone_cat);
515 $form->addItem($allinone);
516
517 // multiple attributes
518 $multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'), 'multiple');
519 $multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAttributeMappingEnabled());
520
521 // attribute selection
522 $attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'), 'atts');
523 $attributes->setMulti(true);
524 $attributes->setValue(
526 $this->getServer()->getServerId(),
527 $this->getMid()
528 )->getAttributeValues()
529 );
530 $attributes->setRequired(true);
532 $multiple->addSubItem($attributes);
533
534 $form->addItem($multiple);
535
536 // role mapping
537 $rm = new ilFormSectionHeaderGUI();
538 $rm->setTitle($this->lng->txt('ecs_role_mappings'));
539 $form->addItem($rm);
540
541 // auth type
542 $auth_type = new ilSelectInputGUI($this->lng->txt('ecs_member_auth_type'), 'auth_mode');
543 $auth_type->setOptions(ilECSMappingUtils::getAuthModeSelection());
544 $auth_type->setRequired(true);
545 $auth_type->setValue(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAuthMode());
546 $form->addItem($auth_type);
547
548 $mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getRoleMappings();
549
550 foreach (ilECSMappingUtils::getRoleMappingInfo() as $name => $info) {
551 $role_map = new ilTextInputGUI($this->lng->txt($info['lang']), (string) $name);
552 if (isset($mapping_defs[$name])) {
553 $role_map->setValue($mapping_defs[$name]);
554 }
555 $role_map->setSize(32);
556 $role_map->setMaxLength(64);
557 $role_map->setRequired($info['required']);
558 $form->addItem($role_map);
559 }
560
561 $form->addCommandButton('cUpdateSettings', $this->lng->txt('save'));
562 $form->addCommandButton('cSettings', $this->lng->txt('cancel'));
563
564 return $form;
565 }
$check
Definition: buildRTE.php:81
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAuthModeSelection()
Get auth mode selection with active authentication modes.
static getCourseMappingFieldSelectOptions()
Creates a path for a start and endnode.
This class represents a selection list property in a property form.
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
$path
Definition: ltiservices.php:32

References $attributes, $check, $name, $path, $tpl, ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), ilECSMappingUtils\getAuthModeSelection(), ilECSMappingUtils\getCourseMappingFieldSelectOptions(), ilECSCourseAttributes\getInstance(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), ilECSMappingUtils\getRoleMappingInfo(), getServer(), ILIAS\Repository\lng(), ROOT_FOLDER_ID, and ilGlobalTemplateInterface\setVariable().

Referenced by cSettings(), and cUpdateSettings().

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

◆ initFormDSettings()

ilECSMappingSettingsGUI::initFormDSettings ( )
protected

Definition at line 658 of file class.ilECSMappingSettingsGUI.php.

659 {
660 $form = new ilPropertyFormGUI();
661 $form->setFormAction($this->ctrl->getFormAction($this));
662 $form->setTitle($this->lng->txt('general_settings'));
663
664 $active = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_activate'), 'active');
665 $active->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled());
666 $form->addItem($active);
667
668 $create_empty = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_create_empty'), 'empty');
669 $create_empty->setChecked(!ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isEmptyContainerCreationEnabled());
670 $create_empty->setInfo($this->lng->txt('ecs_node_mapping_create_empty_info'));
671 $form->addItem($create_empty);
672
673 $form->addCommandButton('dUpdateSettings', $this->lng->txt('save'));
674 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
675
676 return $form;
677 }

References ILIAS\Repository\ctrl(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), getServer(), and ILIAS\Repository\lng().

Referenced by dSettings(), and dUpdateSettings().

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

◆ setSubTabs()

ilECSMappingSettingsGUI::setSubTabs ( int  $a_tab)
protected

Set Sub tabs.

Definition at line 1161 of file class.ilECSMappingSettingsGUI.php.

1161 : void
1162 {
1163 if ($a_tab === self::TAB_DIRECTORY) {
1164 $this->tabs->addSubTab(
1165 'dMappingOverview',
1166 $this->lng->txt('ecs_cc_mapping_overview'),
1167 $this->ctrl->getLinkTarget($this, 'dMappingOverview')
1168 );
1169 $this->tabs->addSubTab(
1170 'dTrees',
1171 $this->lng->txt('ecs_cms_dir_tree'),
1172 $this->ctrl->getLinkTarget($this, 'dTrees')
1173 );
1174 $this->tabs->addSubTab(
1175 'dSettings',
1176 $this->lng->txt('settings'),
1177 $this->ctrl->getLinkTarget($this, 'dSettings')
1178 );
1179 }
1180 if ($a_tab === self::TAB_COURSE) {
1181 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()) {
1182 $this->tabs->addSubTab(
1183 'cInitTree',
1184 $this->lng->txt('ecs_cmap_overview'),
1185 $this->ctrl->getLinkTarget($this, 'cInitOverview')
1186 );
1187 }
1188
1189 $this->tabs->addSubTab(
1190 'cSettings',
1191 $this->lng->txt('settings'),
1192 $this->ctrl->getLinkTarget($this, 'cSettings')
1193 );
1194 }
1195 }

References ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), getServer(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by cInitOverview(), cSettings(), dConfirmDeleteTree(), dMappingOverview(), dSettings(), and dTrees().

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

◆ setTabs()

ilECSMappingSettingsGUI::setTabs ( )
protected

Set tabs.

Definition at line 1135 of file class.ilECSMappingSettingsGUI.php.

1135 : void
1136 {
1137 $this->tabs->clearTargets();
1138 $this->tabs->setBackTarget(
1139 $this->lng->txt('ecs_back_settings'),
1140 $this->ctrl->getParentReturnByClass(self::class)
1141 );
1142 // Directories are only visible for import type campus managment.
1143 if (ilECSParticipantSettings::getInstanceByServerId($this->getServer()->getServerId())->lookupCmsMid() === $this->getMid()) {
1144 $this->tabs->addTab(
1145 'ecs_dir_allocation',
1146 $this->lng->txt('ecs_dir_alloc'),
1147 $this->ctrl->getLinkTarget($this, 'dSettings')
1148 );
1149 }
1150
1151 $this->tabs->addTab(
1152 'ecs_crs_allocation',
1153 $this->lng->txt('ecs_crs_alloc'),
1154 $this->ctrl->getLinkTarget($this, 'cStart')
1155 );
1156 }
static getInstanceByServerId(int $a_server_id)
Get instance by server id.

References ilECSParticipantSettings\getInstanceByServerId(), getMid(), getServer(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

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

Field Documentation

◆ $container

ilECSSettingsGUI ilECSMappingSettingsGUI::$container
private

Definition at line 38 of file class.ilECSMappingSettingsGUI.php.

Referenced by getContainer().

◆ $ctrl

ilCtrl ilECSMappingSettingsGUI::$ctrl
protected

Definition at line 33 of file class.ilECSMappingSettingsGUI.php.

◆ $lng

ilLanguage ilECSMappingSettingsGUI::$lng
protected

Definition at line 32 of file class.ilECSMappingSettingsGUI.php.

◆ $log

ilLogger ilECSMappingSettingsGUI::$log
protected

Definition at line 31 of file class.ilECSMappingSettingsGUI.php.

◆ $mid

int ilECSMappingSettingsGUI::$mid
private

Definition at line 40 of file class.ilECSMappingSettingsGUI.php.

Referenced by __construct(), and getMid().

◆ $server

ilECSSetting ilECSMappingSettingsGUI::$server
private

Definition at line 39 of file class.ilECSMappingSettingsGUI.php.

Referenced by getServer().

◆ $tabs

ilTabsGUI ilECSMappingSettingsGUI::$tabs
private

Definition at line 35 of file class.ilECSMappingSettingsGUI.php.

◆ $toolbar

ilToolbarGUI ilECSMappingSettingsGUI::$toolbar
private

Definition at line 36 of file class.ilECSMappingSettingsGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilECSMappingSettingsGUI::$tpl
protected

Definition at line 34 of file class.ilECSMappingSettingsGUI.php.

Referenced by initFormCSettings().

◆ TAB_COURSE

const ilECSMappingSettingsGUI::TAB_COURSE = 2

Definition at line 29 of file class.ilECSMappingSettingsGUI.php.

◆ TAB_DIRECTORY

const ilECSMappingSettingsGUI::TAB_DIRECTORY = 1

Definition at line 28 of file class.ilECSMappingSettingsGUI.php.


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