ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilECSMappingSettingsGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/WebServices/ECS/classes/class.ilECSSetting.php';
5
6/*
7 * Class for ECS node and directory mapping settings
8 *
9 * @author Stefan Meyer <smeyer.ilias@gmx.de>
10 * @version $ID$
11 *
12 * @ingroup ServicesWebServicesECS
13 * @ilCtrl_isCalledBy ilECSMappingSettingsGUI: ilECSSettingsGUI
14 */
16{
17 const TAB_DIRECTORY = 1;
18 const TAB_COURSE = 2;
19
23 protected $log;
24
25 private $container = null;
26 private $server = null;
27 private $mid = null;
28
29 protected $lng = null;
30 protected $ctrl = null;
31
36 public function __construct($settingsContainer, $server_id, $mid)
37 {
38 global $DIC;
39
40 $lng = $DIC['lng'];
41 $ilCtrl = $DIC['ilCtrl'];
42
43 $this->log = $GLOBALS['DIC']->logger()->wsrv();
44
45 $this->container = $settingsContainer;
46 $this->server = ilECSSetting::getInstanceByServerId($server_id);
47 $this->mid = $mid;
48 $this->lng = $lng;
49 $this->lng->loadLanguageModule('ecs');
50 $this->ctrl = $ilCtrl;
51 }
52
57 public function getContainer()
58 {
59 return $this->container;
60 }
61
66 public function getServer()
67 {
68 return $this->server;
69 }
70
75 public function getMid()
76 {
77 return $this->mid;
78 }
79
83 public function executeCommand()
84 {
85 global $DIC;
86
87 $ilCtrl = $DIC['ilCtrl'];
88
89 $GLOBALS['DIC']['tpl']->setTitle($this->lng->txt('ecs_campus_connect_title'));
90
91 $this->ctrl->saveParameter($this, 'server_id');
92 $this->ctrl->saveParameter($this, 'mid');
93 $this->ctrl->saveParameter($this, 'tid');
94
95 $next_class = $this->ctrl->getNextClass($this);
96 $cmd = $this->ctrl->getCmd();
97
98 $this->setTabs();
99 switch ($next_class) {
100 default:
101 if (!$cmd) {
102 $cmd = "cStart";
103 }
104 $this->$cmd();
105 break;
106 }
107
108 $GLOBALS['DIC']['tpl']->setTitle($this->getServer()->getTitle());
109 $GLOBALS['DIC']['tpl']->setDescription('');
110
111 return true;
112 }
113
117 public function cancel()
118 {
119 $GLOBALS['DIC']['ilCtrl']->returnToParent($this);
120 }
121
122
123
124
125
126
131 protected function cStart()
132 {
133 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
134 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()) {
135 return $this->cInitOverview();
136 }
137 return $this->cSettings();
138 }
139
144 protected function dStart()
145 {
146 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
147 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled()) {
148 return $this->dTrees();
149 }
150 return $this->dSettings();
151 }
152
156 protected function cInitOverview($form = null, $current_attribute = null)
157 {
158 global $DIC;
159
160 $ilTabs = $DIC['ilTabs'];
161
162 $current_node = (array) (($_REQUEST['lnodes']) ? $_REQUEST['lnodes'] : ROOT_FOLDER_ID);
163 $current_node = end($current_node);
164
165 $this->ctrl->setParameter($this, 'lnodes', $current_node);
166
167 $this->setSubTabs(self::TAB_COURSE);
168 $ilTabs->activateTab('ecs_crs_allocation');
169 $ilTabs->activateSubTab('cInitTree');
170
171 $GLOBALS['DIC']['tpl']->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ecs_cmap_overview.html', 'Services/WebServices/ECS');
172
173 $explorer = $this->cShowLocalExplorer();
174 if (!$form instanceof ilPropertyFormGUI) {
175 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
176 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
177
178 if ($current_attribute === null) {
179 // check request
180 $current_attribute = (string) $_REQUEST['ecs_ca'];
181 if (!$current_attribute) {
183 $this->getServer()->getServerId(),
184 $this->getMid(),
185 $current_node
186 );
187
188 $current_attribute =
189 $existing ?
190 $existing :
191 '';
192 /*
193 ilECSCourseAttributes::getInstance(
194 $this->getServer()->getServerId(),
195 $this->getMid())->getFirstAttributeName()
196 );
197 */
198 }
199 }
200 $form = $this->cInitMappingForm($current_node, $current_attribute);
201 }
202
203 $GLOBALS['DIC']['tpl']->setVariable('TFORM_ACTION', $this->ctrl->getFormAction($this));
204 $GLOBALS['DIC']['tpl']->setVariable('LOCAL_EXPLORER', $explorer->getOutput());
205 $GLOBALS['DIC']['tpl']->setVariable('MAPPING_FORM', $form->getHTML());
206 }
207
211 protected function cAddAttribute()
212 {
213 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
214 $next_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getNextAttributeName((string) $_REQUEST['ecs_ca']);
215 $this->cInitOverview(null, $next_attribute);
216 }
217
221 protected function cDeleteAttribute()
222 {
223 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
224 $prev_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getPreviousAttributeName((string) $_REQUEST['ecs_ca']);
225 $this->cInitOverview(null, $prev_attribute);
226 }
227
231 protected function cShowLocalExplorer()
232 {
233 global $DIC;
234
235 $tree = $DIC['tree'];
236
237 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
238 $explorer = new ilECSNodeMappingLocalExplorer(
239 $this->ctrl->getLinkTarget($this, 'cInitOverview'),
240 $this->getServer()->getServerId(),
241 $this->getMid()
242 );
243 $explorer->setPostVar('lnodes[]');
244
245 $lnodes = (array) $_REQUEST['lnodes'];
246 $checked_node = array_pop($lnodes);
247 if ((int) $_REQUEST['lid']) {
248 $checked_node = (int) $_REQUEST['lid'];
249 }
250
251 if ($checked_node) {
252 $explorer->setCheckedItems(array($checked_node));
253 } else {
254 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
255 }
256 $explorer->setTargetGet('lref_id');
257 $explorer->setSessionExpandVariable('lexpand');
258 $explorer->setExpand((int) $_GET['lexpand']);
259 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'cInitOverview'));
260 $explorer->setOutput(0);
261 return $explorer;
262 }
263
267 protected function cInitMappingForm($current_node, $current_attribute)
268 {
269 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
270 $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
271
272 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
273 $form = new ilPropertyFormGUI();
274 $form->setTableWidth("100%");
275 $this->ctrl->setParameter($this, 'ecs_ca', $current_attribute);
276 $form->setFormAction($this->ctrl->getFormAction($this));
277 $this->ctrl->setParameter($this, 'ecs_ca', '');
278
279 $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') . ' ' . ilObject::_lookupTitle(ilObject::_lookupObjId($current_node)));
280
281 // Iterate through all current attributes
282 $attributes = $attributes_obj->getAttributeSequence($current_attribute);
283 foreach ($attributes as $att_name) {
284 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
285 $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name);
286
288 $section->setTitle($this->lng->txt('ecs_cmap_att_' . $att_name));
289
290 // Filter
291 $form->addItem($section);
292
293 $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'), $att_name . '_is_filter');
294 $isfilter->setValue($rule->isFilterEnabled() ? 1 : 0);
295
296 $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'), 0);
297 $isfilter->addOption($all_values);
298
299 $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'), 1);
300 $filter = new ilTextInputGUI('', $att_name . '_filter');
301 $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info'));
302 $filter->setSize(50);
303 $filter->setMaxLength(512);
304 $filter->setRequired(true);
305 $filter->setValue($rule->getFilter());
306 $use_filter->addSubItem($filter);
307
308 $isfilter->addOption($use_filter);
309
310 $form->addItem($isfilter);
311
312 // Create subdirs
313 $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'), $att_name . '_subdirs');
314 $subdirs->setChecked($rule->isSubdirCreationEnabled());
315 $subdirs->setValue(1);
316
317 // Subdir types (disabled in spec)
318 /*
319 $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type');
320 $subdir_type->setValue($rule->getSubDirectoryType());
321
322 $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'), ilECSCourseMappingRule::SUBDIR_VALUE);
323 $subdir_type->addOption($value);
324
325 $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'), ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME);
326 $subdir_type->addOption($name);
327
328 $subdirs->addSubItem($subdir_type);
329 */
330 $form->addItem($subdirs);
331
332 // Directory relations
333 /*
334 $upper_attributes = ilECSCourseAttributes::getInstance(
335 $this->getServer()->getServerId(),
336 $this->getMid())->getUpperAttributes($att_name);
337
338 if($upper_attributes)
339 {
340 $dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation');
341
342 $current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),'');
343 $dir_relation->addOption($current_dir);
344 }
345 foreach($upper_attributes as $subdir_name)
346 {
347 $subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name);
348 $dir_relation->addOption($subdir);
349 }
350 if($upper_attributes)
351 {
352 $dir_relation->setValue((string) $rule->getDirectory());
353 $form->addItem($dir_relation);
354 }
355 */
356 }
357
358 // add list of attributes
359 $hidden_atts = new ilHiddenInputGUI('attributes');
360 $hidden_atts->setValue(implode(',', $attributes));
361 $form->addItem($hidden_atts);
362
363
364 if ($current_attribute) {
365 $form->addCommandButton('cSaveOverview', $this->lng->txt('save'));
366 }
367
368 if ($attributes_obj->getNextAttributeName($current_attribute)) {
369 $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn'));
370 }
371 if ($attributes_obj->getPreviousAttributeName($current_attribute)) {
372 $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn'));
373 }
375 $this->getServer()->getServerId(),
376 $this->getMid(),
377 $current_node
378 )) {
379 $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule'));
380 }
381
382 #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel'));
383
384 $form->setShowTopButtons(false);
385
386 return $form;
387 }
388
392 protected function cSaveOverview()
393 {
394 $current_node = (int) $_REQUEST['lnodes'];
395 $current_att = (string) $_REQUEST['ecs_ca'];
396 $form = $this->cInitMappingForm($current_node, $current_att);
397
398 if ($form->checkInput()) {
399 // save ...
400 $all_attributes = explode(',', $form->getInput('attributes'));
401 foreach ((array) $all_attributes as $att_name) {
403 $this->getServer()->getServerId(),
404 $this->getMid(),
405 $current_node,
406 $att_name
407 );
408 $rule->setServerId($this->getServer()->getServerId());
409 $rule->setMid($this->getMid());
410 $rule->setRefId($current_node);
411 $rule->setAttribute($att_name);
412 $rule->enableFilter($form->getInput($att_name . '_is_filter'));
413 $rule->setFilter($form->getInput($att_name . '_filter'));
414 $rule->enableSubdirCreation($form->getInput($att_name . '_subdirs'));
415 //$rule->setSubDirectoryType($form->getInput($att_name.'_subdir_type'));
416 //$rule->setDirectory($form->getInput($att_name.'_dir_relation'));
417
418 if ($rule->getRuleId()) {
419 $rule->update();
420 } else {
421 $rule->save();
422 }
423 }
424
425 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
426 $this->ctrl->setParameter($this, 'lnodes', $current_node);
427 $this->ctrl->redirect($this, 'cInitOverview');
428 }
429
430 $form->setValuesByPost();
431 ilUtil::sendFailure($this->lng->txt('err_check_input'));
432 $this->cInitOverview($form, $current_att);
433 }
434
435 protected function cDeleteRulesOfNode()
436 {
437 $current_node = (int) $_REQUEST['lnodes'];
438
439 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
441 $this->getServer()->getServerId(),
442 $this->getMid(),
443 $current_node
444 );
445
446 foreach ($rules as $rid) {
447 $rule = new ilECSCourseMappingRule($rid);
448 $rule->delete();
449 }
450 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
451 $this->ctrl->redirect($this, 'cInitOverview');
452 }
453
454
455
456
462 protected function cSettings(ilPropertyFormGUI $form = null)
463 {
464 global $DIC;
465
466 $ilTabs = $DIC['ilTabs'];
467
468 $this->setSubTabs(self::TAB_COURSE);
469 $ilTabs->activateTab('ecs_crs_allocation');
470 $ilTabs->activateSubTab('cSettings');
471
472 if (!$form instanceof ilPropertyFormGUI) {
473 $form = $this->initFormCSettings();
474 }
475
476 $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
477
478 return true;
479 }
480
484 protected function initFormCSettings()
485 {
486 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
487
488 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
489 $form = new ilPropertyFormGUI();
490 $form->setFormAction($this->ctrl->getFormAction($this));
491 $form->setTitle($this->lng->txt('settings'));
492
493 // individual course allocation
494 $check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled');
495 $check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled());
496 $form->addItem($check);
497
498
499 // add default container
500 $imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'), 'default_cat');
501 $imp->setRequired(true);
502
503 $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
504 $tpl->setVariable('SIZE', 5);
505 $tpl->setVariable('MAXLENGTH', 11);
506 $tpl->setVariable('POST_VAR', 'default_cat');
507
508 $default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getDefaultCourseCategory();
509 $tpl->setVariable('PROPERTY_VALUE', $default);
510
511 if ($default) {
512 include_once './Services/Tree/classes/class.ilPathGUI.php';
513 $path = new ilPathGUI();
514 $path->enableTextOnly(false);
515 $path->enableHideLeaf(false);
516 $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
517 }
518
519 $imp->setHtml($tpl->get());
520 $imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info'));
521 $form->addItem($imp);
522
523 // all in one category
524 $allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'), 'allinone');
525 $allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAllInOneCategoryEnabled());
526 $allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info'));
527
528 $allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'), 'allinone_cat');
529 $allinone_cat->setRequired(true);
530
531 $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
532 $tpl->setVariable('SIZE', 5);
533 $tpl->setVariable('MAXLENGTH', 11);
534 $tpl->setVariable('POST_VAR', 'allinone_cat');
535
536 $cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAllInOneCategory();
537 $tpl->setVariable('PROPERTY_VALUE', $cat);
538 if ($cat) {
539 include_once './Services/Tree/classes/class.ilPathGUI.php';
540 $path = new ilPathGUI();
541 $path->enableTextOnly(false);
542 $path->enableHideLeaf(false);
543 $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
544 }
545
546 $allinone_cat->setHtml($tpl->get());
547 $allinone->addSubItem($allinone_cat);
548 $form->addItem($allinone);
549
550 // multiple attributes
551 $multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'), 'multiple');
552 $multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAttributeMappingEnabled());
553
554 // attribute selection
555 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
556 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
557 $attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'), 'atts');
558 $attributes->setMulti(true);
559 $attributes->setValue(
561 $this->getServer()->getServerId(),
562 $this->getMid()
563 )->getAttributeValues()
564 );
565 $attributes->setRequired(true);
567 $multiple->addSubItem($attributes);
568
569 $form->addItem($multiple);
570
571 // role mapping
572 $rm = new ilFormSectionHeaderGUI();
573 $rm->setTitle($this->lng->txt('ecs_role_mappings'));
574 $form->addItem($rm);
575
576 // auth type
577 $auth_type = new ilSelectInputGUI($this->lng->txt('ecs_member_auth_type'), 'auth_mode');
578 $auth_type->setOptions(ilECSMappingUtils::getAuthModeSelection());
579 $auth_type->setRequired(true);
580 $auth_type->setValue(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAuthMode());
581 $form->addItem($auth_type);
582
583 $mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getRoleMappings();
584
585 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
587 $role_map = new ilTextInputGUI($this->lng->txt($info['lang']), $name);
588 $role_map->setValue($mapping_defs[$name]);
589 $role_map->setSize(32);
590 $role_map->setMaxLength(64);
591 $role_map->setRequired($info['required']);
592 $form->addItem($role_map);
593 }
594
595 $form->addCommandButton('cUpdateSettings', $this->lng->txt('save'));
596 $form->addCommandButton('cSettings', $this->lng->txt('cancel'));
597
598 return $form;
599 }
600
605 protected function dSettings(ilPropertyFormGUI $form = null)
606 {
607 global $DIC;
608
609 $ilTabs = $DIC['ilTabs'];
610
611 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
612 $this->setSubTabs(self::TAB_DIRECTORY);
613 $ilTabs->activateTab('ecs_dir_allocation');
614 $ilTabs->activateSubTab('dSettings');
615
616 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
617 if (!$form instanceof ilPropertyFormGUI) {
618 $form = $this->initFormDSettings();
619 }
620
621 $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
622
623 return true;
624 }
625
629 protected function cUpdateSettings()
630 {
631 $form = $this->initFormCSettings();
632 if ($form->checkInput()) {
633 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
634 $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid());
635 $settings->enableCourseAllocation($form->getInput('enabled'));
636 $settings->setDefaultCourseCategory($form->getInput('default_cat'));
637 $settings->enableAllInOne($form->getInput('allinone'));
638 $settings->setAllInOneCategory($form->getInput('allinone_cat'));
639 $settings->enableAttributeMapping($form->getInput('multiple'));
640 $settings->setAuthMode($form->getInput('auth_mode'));
641
642
643 $role_mappings = array();
645 $role_mappings[$name] = $form->getInput($name);
646 }
647 $settings->setRoleMappings($role_mappings);
648 $settings->update();
649
650 // store attribute settings
651 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
652 $attributes = new ilECSCourseAttributes($this->getServer()->getServerId(), $this->getMid());
653 $attributes->delete();
654
655 $form_atts = $form->getInput('atts');
656
657 foreach ($form_atts as $name) {
658 if (!$name) {
659 continue;
660 }
661
662 $att = new ilECSCourseAttribute();
663 $att->setServerId($this->getServer()->getServerId());
664 $att->setMid($this->getMid());
665 $att->setName($name);
666 $att->save();
667 }
668
669 //$att = new ilECSCourseAttribute();
670 //$att->setName($a_name)
671
672 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
673 $GLOBALS['DIC']['ilCtrl']->redirect($this, 'cSettings');
674 }
675 ilUtil::sendFailure($this->lng->txt('err_check_input'));
676 $form->setValuesByPost();
677 $this->cSettings($form);
678 }
679
684 protected function cAttributes()
685 {
686 global $DIC;
687
688 $ilTabs = $DIC['ilTabs'];
689
690 $this->setSubTabs(self::TAB_COURSE);
691 $ilTabs->setTabActive('ecs_crs_allocation');
692 $ilTabs->setSubTabActive('cAttributes');
693
694 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributesTableGUI.php';
695 $table = new ilECSCourseAttributesTableGUI(
696 $this,
697 'attributes',
698 $this->getServer()->getServerId(),
699 $this->getMid()
700 );
701 $table->init();
702 $table->parse(
704 $this->getServer()->getServerId(),
705 $this->getMid()
706 )->getAttributes()
707 );
708
709 $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
710 }
711
712
713
717 protected function dUpdateSettings()
718 {
719 global $DIC;
720
721 $ilCtrl = $DIC['ilCtrl'];
722
723 $form = $this->initFormDSettings();
724 if ($form->checkInput()) {
725 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
726 $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid());
727 $settings->enableDirectoryMapping((bool) $form->getInput('active'));
728 $settings->enableEmptyContainerCreation(!$form->getInput('empty'));
729 $settings->update();
730 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
731 } else {
732 ilUtil::sendFailure($this->lng->txt('err_check_input'), true);
733 $form->setValuesByPost();
734 }
735 $ilCtrl->redirect($this, 'dSettings');
736 }
737
741 protected function initFormDSettings()
742 {
743 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
744 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
745
746 $form = new ilPropertyFormGUI();
747 $form->setFormAction($this->ctrl->getFormAction($this));
748 $form->setTitle($this->lng->txt('general_settings'));
749
750 $active = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_activate'), 'active');
751 $active->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled());
752 $form->addItem($active);
753
754 $create_empty = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_create_empty'), 'empty');
755 $create_empty->setChecked(!ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isEmptyContainerCreationEnabled());
756 $create_empty->setInfo($this->lng->txt('ecs_node_mapping_create_empty_info'));
757 $form->addItem($create_empty);
758
759 $form->addCommandButton('dUpdateSettings', $this->lng->txt('save'));
760 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
761
762 return $form;
763 }
764
768 protected function dTrees()
769 {
770 global $DIC;
771
772 $ilToolbar = $DIC['ilToolbar'];
773
774 $this->setSubTabs(self::TAB_DIRECTORY);
775 $GLOBALS['DIC']['ilTabs']->activateSubTab('dTrees');
776 $GLOBALS['DIC']['ilTabs']->activateTab('ecs_dir_allocation');
777
778 $ilToolbar->addButton(
779 $this->lng->txt('ecs_sync_trees'),
780 $this->ctrl->getLinkTarget($this, 'dSynchronizeTrees')
781 );
782
783 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingTreeTableGUI.php';
784
785 $dtreeTable = new ilECSNodeMappingTreeTableGUI(
786 $this->getServer()->getServerId(),
787 $this->getMid(),
788 $this,
789 'dtree'
790 );
791
792
793 $dtreeTable->parse();
794 $GLOBALS['DIC']['tpl']->setContent($dtreeTable->getHTML());
795 return true;
796 }
797
801 protected function dConfirmDeleteTree()
802 {
803 $this->setSubTabs(self::TAB_DIRECTORY);
804 $GLOBALS['DIC']['ilTabs']->activateSubTab('dTrees');
805 $GLOBALS['DIC']['ilTabs']->activateTab('ecs_dir_allocation');
806
807 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
808 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
809
810 $confirm = new ilConfirmationGUI();
811 $confirm->setFormAction($this->ctrl->getFormAction($this));
812 $confirm->setHeaderText($this->lng->txt('ecs_confirm_delete_tree'));
813
814 $confirm->addItem(
815 'tid',
816 (int) $_REQUEST['tid'],
818 $this->getServer()->getServerId(),
819 $this->getMid(),
820 (int) $_REQUEST['tid']
821 )
822 );
823 $confirm->setConfirm($this->lng->txt('delete'), 'dDeleteTree');
824 $confirm->setCancel($this->lng->txt('cancel'), 'dTrees');
825
826 $GLOBALS['DIC']['tpl']->setContent($confirm->getHTML());
827 }
828
832 protected function dDeleteTree()
833 {
834 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
835 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
836
837 $GLOBALS['DIC']['ilLog']->write('Deleting tree');
838
839 $tree = new ilECSCmsTree((int) $_REQUEST['tid']);
840 $tree->deleteTree($tree->getNodeData(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
841
842
843
844 // also delete import information
845 include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
847 $this->getServer()->getServerId(),
848 $this->getMid(),
850 $this->getServer()->getServerId(),
851 $this->getMid(),
852 (int) $_REQUEST['tid']
853 )
854 );
855
856 $data = new ilECSCmsData();
857 $data->setServerId($this->getServer()->getServerId());
858 $data->setMid($this->getMid());
859 $data->setTreeId((int) $_REQUEST['tid']);
860 $data->deleteTree();
861
862
863 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
865 $this->getServer()->getServerId(),
866 $this->getMid(),
867 (int) $_REQUEST['tid']
868 );
869
870 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_deleted'), true);
871 $this->ctrl->redirect($this, 'dTrees');
872 }
873
877 protected function dEditTree(ilPropertyFormGUI $form = null)
878 {
879 $GLOBALS['DIC']['tpl']->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ecs_edit_tree.html', 'Services/WebServices/ECS');
880
881 $this->ctrl->saveParameter($this, 'cid');
882
883 $GLOBALS['DIC']['ilTabs']->clearTargets();
884 $GLOBALS['DIC']['ilTabs']->setBack2Target(
885 $this->lng->txt('ecs_back_settings'),
886 $this->ctrl->getLinkTarget($this, 'cancel')
887 );
888 $GLOBALS['DIC']['ilTabs']->setBackTarget(
889 $this->lng->txt('ecs_cms_dir_tree'),
890 $this->ctrl->getLinkTarget($this, 'dTrees')
891 );
892
893 $GLOBALS['DIC']['tpl']->setVariable('LEGEND', $GLOBALS['DIC']['lng']->txt('ecs_status_legend'));
894 $GLOBALS['DIC']['tpl']->setVariable('PENDING_UNMAPPED', $GLOBALS['DIC']['lng']->txt('ecs_status_pending_unmapped'));
895 $GLOBALS['DIC']['tpl']->setVariable('PENDING_UNMAPPED_DISCON', $GLOBALS['DIC']['lng']->txt('ecs_status_pending_unmapped_discon'));
896 $GLOBALS['DIC']['tpl']->setVariable('PENDING_UNMAPPED_NONDISCON', $GLOBALS['DIC']['lng']->txt('ecs_status_pending_unmapped_nondiscon'));
897 $GLOBALS['DIC']['tpl']->setVariable('MAPPED', $GLOBALS['DIC']['lng']->txt('ecs_status_mapped'));
898 $GLOBALS['DIC']['tpl']->setVariable('DELETED', $GLOBALS['DIC']['lng']->txt('ecs_status_deleted'));
899
901 $GLOBALS['DIC']['tpl']->setVariable('GENERAL_FORM', $form->getHTML());
902 $GLOBALS['DIC']['tpl']->setVariable('TFORM_ACTION', $this->ctrl->getFormAction($this, 'dEditTree'));
903
904 $explorer = $this->dShowLocalExplorer();
905 $this->dShowCmsExplorer($explorer);
906 }
907
912 {
913 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
914 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
915
916 if ($form instanceof ilPropertyFormGUI) {
917 return $form;
918 }
919
920 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
921 $assignment = new ilECSNodeMappingAssignment(
922 $this->getServer()->getServerId(),
923 $this->getMid(),
924 (int) $_REQUEST['tid'],
925 0
926 );
927
928 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
929 $form = new ilPropertyFormGUI();
930 $form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree'));
931 $form->setTitle($this->lng->txt('general_settings'));
932 $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
933 $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
934 $form->setTableWidth('30%');
935
936 // CMS id (readonly)
937 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
938 $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
939 $cmsid->setValue(
941 );
942 $cmsid->setDisabled(true);
943 $cmsid->setSize(7);
944 $cmsid->setMaxLength(12);
945 $form->addItem($cmsid);
946
947
949 $this->getServer()->getServerId(),
950 $this->getMid(),
951 (int) $_REQUEST['tid']
952 );
953 $mapping_advanced = ($mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false);
954
955 // Status (readonly)
956 $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
957 $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
958 $form->addItem($status);
959
960 // title update
961 $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
962 $title->setValue(1);
963 $title->setChecked($assignment->isTitleUpdateEnabled());
964 #$title->setInfo($this->lng->txt('ecs_title_update_info'));
965 $form->addItem($title);
966
967
968 $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
969 $position->setDisabled(!$mapping_advanced);
970 $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
971 $position->setValue(1);
972 #$position->setInfo($this->lng->txt('ecs_position_update_info'));
973 $form->addItem($position);
974
975 $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
976 $tree->setDisabled(!$mapping_advanced);
977 $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
978 $tree->setValue(1);
979 #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
980 $form->addItem($tree);
981
982 return $form;
983 }
984
989 protected function dUpdateTreeSettings()
990 {
991 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
992 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
993 $assignment = new ilECSNodeMappingAssignment(
994 $this->getServer()->getServerId(),
995 $this->getMid(),
996 (int) $_REQUEST['tid'],
997 0
998 );
999 $assignment->setRefId(0);
1000 $assignment->setObjId(0);
1001
1002 $form = $this->dInitFormTreeSettings();
1003 if ($form->checkInput()) {
1004 $assignment->enableTitleUpdate($form->getInput('title'));
1005 $assignment->enableTreeUpdate($form->getInput('tree'));
1006 $assignment->enablePositionUpdate($form->getInput('position'));
1007 $assignment->update();
1008
1009 ilUtil::sendSuccess($this->lng->txt('settings_saved', true));
1010 $this->ctrl->redirect($this, 'dEditTree');
1011 }
1012
1013 $form->setValuesByPost();
1014 ilUtil::sendFailure($this->lng->txt('err_check_input'));
1015 $this->dEditTree($form);
1016 return true;
1017 }
1018
1022 protected function dSynchronizeTree()
1023 {
1024 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTreeSynchronizer.php';
1026 $this->getServer(),
1027 $this->mid,
1028 (int) $_REQUEST['tid']
1029 );
1030 $sync->sync();
1031 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_synchronized'), true);
1032 $this->ctrl->redirect($this, 'dTrees');
1033 }
1034
1035 protected function dSynchronizeTrees()
1036 {
1037 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
1038
1039 $this->log->dump('Start synchronizing cms directory trees');
1040
1041 try {
1042 $connector = new ilECSDirectoryTreeConnector($this->getServer());
1043 $res = $connector->getDirectoryTrees();
1044
1045 $this->log->dump($res, ilLogLevel::DEBUG);
1046
1047 foreach ((array) $res->getLinkIds() as $cms_id) {
1048 include_once './Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
1049 include_once './Services/WebServices/ECS/classes/class.ilECSEvent.php';
1050 $event = new ilECSEventQueueReader($this->getServer()->getServerId());
1051 $event->add(
1053 $cms_id,
1055 );
1056 }
1057 $this->ctrl->redirect($this, 'dTrees');
1058 } catch (Exception $e) {
1059 ilUtil::sendFailure($e->getMessage(), true);
1060 $this->ctrl->redirect($this, 'dTrees');
1061 }
1062 }
1063
1067 protected function dShowLocalExplorer()
1068 {
1069 global $DIC;
1070
1071 $tree = $DIC['tree'];
1072
1073 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
1074 $explorer = new ilECSNodeMappingLocalExplorer(
1075 $this->ctrl->getLinkTarget($this, 'dEditTree'),
1076 $this->getServer()->getServerId(),
1077 $this->getMid()
1078 );
1079 $explorer->setPostVar('lnodes[]');
1080
1081 $lnodes = (array) $_REQUEST['lnodes'];
1082 $checked_node = array_pop($lnodes);
1083 if ((int) $_REQUEST['lid']) {
1084 $checked_node = (int) $_REQUEST['lid'];
1085 }
1086
1087 if ($checked_node) {
1088 $explorer->setCheckedItems(array($checked_node));
1089 } else {
1090 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
1091 }
1092 $explorer->setTargetGet('lref_id');
1093 $explorer->setSessionExpandVariable('lexpand');
1094 $explorer->setExpand((int) $_GET['lexpand']);
1095 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'dEditTree'));
1096 $explorer->setOutput(0);
1097 $GLOBALS['DIC']['tpl']->setVariable('LOCAL_EXPLORER', $explorer->getOutput());
1098
1099 return $explorer;
1100 }
1101
1105 protected function dShowCmsExplorer(ilExplorer $localExplorer)
1106 {
1107 global $DIC;
1108
1109 $tree = $DIC['tree'];
1110
1111 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1112 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingCmsExplorer.php';
1113 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1114
1115 $explorer = new ilECSNodeMappingCmsExplorer(
1116 $this->ctrl->getLinkTarget($this, 'dEditTree'),
1117 $this->getServer()->getServerId(),
1118 $this->getMid(),
1119 (int) $_REQUEST['tid']
1120 );
1121 $explorer->setRoot(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid']));
1122 $explorer->setTree(
1123 new ilECSCmsTree(
1124 (int) $_REQUEST['tid']
1125 )
1126 );
1127 $explorer->setPostVar('rnodes[]');
1128
1129 // Read checked items from mapping of checked items in local explorer
1130 $active_node = $tree->getRootId();
1131 foreach ($localExplorer->getCheckedItems() as $ref_id) {
1132 $explorer->setCheckedItems(
1134 $this->getServer()->getServerId(),
1135 $this->getMid(),
1136 (int) $_REQUEST['tid'],
1137 $ref_id
1138 )
1139 );
1140 $active_node = $ref_id;
1141 }
1142
1143
1144 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1145 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1146 $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1148 $this->getServer()->getServerId(),
1149 $this->getMid(),
1150 (int) $_REQUEST['tid'],
1151 $active_node
1152 ) as $cs_id) {
1153 foreach ($cmsTree->getPathId($cs_id) as $path_id) {
1154 #$explorer->setExpand($path_id);
1155 }
1156 }
1157
1158 $explorer->setTargetGet('rref_id');
1159 $explorer->setSessionExpandVariable('rexpand');
1160
1161 #if((int) $_REQUEST['rexpand'])
1162 {
1163 $explorer->setExpand((int) $_GET['rexpand']);
1164 }
1165 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'dEditTree'));
1166 $explorer->setOutput(0);
1167 $GLOBALS['DIC']['tpl']->setVariable('REMOTE_EXPLORER', $explorer->getOutput());
1168 }
1169
1174 protected function dInitEditTree()
1175 {
1176 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
1178 $this->getServer()->getServerId(),
1179 $this->getMid(),
1180 (int) $_REQUEST['tid']
1181 );
1182 return $this->dEditTree();
1183 }
1184
1185
1189 protected function dMap()
1190 {
1191 if (!$_POST['lnodes']) {
1192 ilUtil::sendFailure($this->lng->txt('select_one'), true);
1193 $this->ctrl->redirect($this, 'dEditTree');
1194 }
1195
1196 $ref_id = end($_POST['lnodes']);
1197
1198 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1200 $this->getServer()->getServerId(),
1201 $this->getMid(),
1202 (int) $_REQUEST['tid'],
1203 $ref_id
1204 );
1205
1206
1207 $nodes = (array) $_POST['rnodes'];
1208 $nodes = (array) array_reverse($nodes);
1209
1210 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
1211 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1212 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1213 foreach ($nodes as $cms_id) {
1214 $assignment = new ilECSNodeMappingAssignment(
1215 $this->getServer()->getServerId(),
1216 $this->getMid(),
1217 (int) $_REQUEST['tid'],
1218 (int) $cms_id
1219 );
1220 $assignment->setRefId($ref_id);
1221 $assignment->setObjId(ilObject::_lookupObjId($ref_id));
1222 $assignment->enablePositionUpdate(false);
1223 $assignment->enableTreeUpdate(false);
1224 $assignment->enableTitleUpdate(ilECSNodeMappingAssignments::lookupDefaultTitleUpdate(
1225 $this->getServer()->getServerId(),
1226 $this->getMid(),
1227 (int) $_REQUEST['tid']
1228 ));
1229 $assignment->update();
1230
1231 // Delete subitems mappings for cms subtree
1232 $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1233 $childs = $cmsTree->getSubTreeIds($cms_id);
1234
1236 $this->getServer()->getServerId(),
1237 $this->getMid(),
1238 (int) $_REQUEST['tid'],
1239 $childs
1240 );
1241 }
1242
1244 $this->getServer()->getServerId(),
1245 $this->getMid(),
1246 (int) $_REQUEST['tid']
1247 );
1248
1249 // Save parameter cid
1250 $this->ctrl->setParameter($this, 'lid', (int) $ref_id);
1251
1252 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1253 $this->ctrl->redirect($this, 'dEditTree');
1254 }
1255
1259 protected function dMappingOverview()
1260 {
1261 $this->setSubTabs(self::TAB_DIRECTORY);
1262 $GLOBALS['DIC']['ilTabs']->activateSubTab('dMappingOverview');
1263 $GLOBALS['DIC']['ilTabs']->activateTab('ecs_dir_allocation');
1264 }
1265
1266
1267
1272 protected function setTabs()
1273 {
1274 global $DIC;
1275
1276 $ilTabs = $DIC['ilTabs'];
1277
1278 include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
1279
1280 $ilTabs->clearTargets();
1281 $ilTabs->setBackTarget(
1282 $this->lng->txt('ecs_back_settings'),
1283 $this->ctrl->getParentReturn($this)
1284 );
1285 // Directories are only visible for import type campus managment.
1286 if (ilECSParticipantSettings::loookupCmsMid($this->getServer()->getServerId()) == $this->getMid()) {
1287 $ilTabs->addTab(
1288 'ecs_dir_allocation',
1289 $this->lng->txt('ecs_dir_alloc'),
1290 $this->ctrl->getLinkTarget($this, 'dSettings')
1291 );
1292 }
1293
1294 $ilTabs->addTab(
1295 'ecs_crs_allocation',
1296 $this->lng->txt('ecs_crs_alloc'),
1297 $this->ctrl->getLinkTarget($this, 'cStart')
1298 );
1299 }
1300
1306 protected function setSubTabs($a_tab)
1307 {
1308 global $DIC;
1309
1310 $ilTabs = $DIC['ilTabs'];
1311
1312 if ($a_tab == self::TAB_DIRECTORY) {
1313 $ilTabs->addSubTab(
1314 'dMappingOverview',
1315 $this->lng->txt('ecs_cc_mapping_overview'),
1316 $this->ctrl->getLinkTarget($this, 'dMappingOverview')
1317 );
1318 $ilTabs->addSubTab(
1319 'dTrees',
1320 $this->lng->txt('ecs_cms_dir_tree'),
1321 $this->ctrl->getLinkTarget($this, 'dTrees')
1322 );
1323 $ilTabs->addSubTab(
1324 'dSettings',
1325 $this->lng->txt('settings'),
1326 $this->ctrl->getLinkTarget($this, 'dSettings')
1327 );
1328 }
1329 if ($a_tab == self::TAB_COURSE) {
1330 // Check if attributes are available
1331 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
1332 $atts = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
1333
1334 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
1335 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()) {
1336 $ilTabs->addSubTab(
1337 'cInitTree',
1338 $this->lng->txt('ecs_cmap_overview'),
1339 $this->ctrl->getLinkTarget($this, 'cInitOverview')
1340 );
1341 }
1342
1343 $ilTabs->addSubTab(
1344 'cSettings',
1345 $this->lng->txt('settings'),
1346 $this->ctrl->getLinkTarget($this, 'cSettings')
1347 );
1348 }
1349 }
1350}
$tpl
Definition: ilias.php:10
$section
Definition: Utf8Test.php:83
$path
Definition: aliased.php:25
$default
Definition: build.php:20
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
This class represents a checkbox property in a property form.
Confirmation screen class.
This class represents a custom property in a property form.
static updateStatus($a_server_id, $a_mid, $a_tree_id)
static lookupCmsId($a_obj_id)
Lookup cms id.
static lookupCmsIdsOfTree($a_server_id, $a_mid, $a_tree_id)
@global $ilDB $ilDB
static lookupTitle($a_server_id, $a_mid, $a_tree_id)
Lookup title by obj id.
static lookupRootId($a_tree_id)
lookup root id
Storage of course attributes for assignment rules.
Storage of course attributes for assignment rules.
static getInstance($a_server_id, $a_mid)
Get instance.
static lookupLastExistingAttribute($a_sid, $a_mid, $a_ref_id)
Lookup existing attributes.
static hasRules($a_sid, $a_mid, $a_ref_id)
static getRulesOfRefId($a_sid, $a_mid, $a_ref_id)
Get all rule of ref_id @global type $ilDB.
static getInstanceByAttribute($a_sid, $a_mid, $a_ref_id, $a_att)
Get rule instance by attribute @global type $ilDB.
Reads ECS events and stores them in the database.
static deleteRessources($a_server_id, $a_mid, $a_econtent_ids)
Delete ressources @global $ilDB.
cSettings(ilPropertyFormGUI $form=null)
Show course allocation @global ilTabsGUI $ilTabs.
setSubTabs($a_tab)
Set Sub tabs @global ilTabsGUI $ilTabs.
dSettings(ilPropertyFormGUI $form=null)
Show directory allocation @global ilTabsGUI $ilTabs.
dEditTree(ilPropertyFormGUI $form=null)
Edit directory tree assignments.
cUpdateSettings()
Update course settings.
__construct($settingsContainer, $server_id, $mid)
Constructor.
dUpdateSettings()
Update node mapping settings.
dConfirmDeleteTree()
Delete tree settings.
cancel()
return to parent container
dShowCmsExplorer(ilExplorer $localExplorer)
Show cms explorer.
cAddAttribute()
Add one attribute in form.
cDeleteAttribute()
Delete last attribute in form.
cInitOverview($form=null, $current_attribute=null)
Show overview page.
dInitFormTreeSettings(ilPropertyFormGUI $form=null)
Init form settings.
setTabs()
Set tabs @global ilTabsGUI $ilTabs.
cAttributes()
Show active attributes @global ilTabsGUI $ilTabs.
cInitMappingForm($current_node, $current_attribute)
Init the mapping form.
static getRoleMappingInfo($a_role_type_info=0)
Get role mapping info.
static mappingStatusToString($a_status)
Get mapping status as string.
static getAuthModeSelection()
Get auth mode selection.
static getCourseMappingFieldSelectOptions()
static lookupMappingStatus($a_server_id, $a_mid, $a_tree_id)
Lookup mapping status.
static lookupDefaultTitleUpdate($a_server_id, $a_mid, $a_tree_id)
Lookup default title update setting.
static lookupMappedItemsForRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Get cs ids for ref_id @global <type> $ilDB.
static deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $cs_ids)
Delete mappings @global $ilDB.
static deleteMappings($a_server_id, $a_mid, $a_tree_id)
Delete mappings @global $ilDB $ilDB.
static lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Lookup assignments.
static deleteDisconnectableMappings($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
delete disconnectable mappings
static getInstanceByServerMid($a_server_id, $a_mid)
Get instance.
static loookupCmsMid($a_server_id)
Lookup mid of current cms participant @global $ilDB.
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
Class ilExplorer class for explorer view in admin frame.
This class represents a section header in a property form.
This class represents a hidden form property in a property form.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
Creates a path for a start and endnode.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
global $ilCtrl
Definition: ilias.php:18
$info
Definition: index.php:5
$sync
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$rule
Definition: showstats.php:43
$data
Definition: bench.php:6