ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $lng,$ilCtrl;
39
40 $this->log = $GLOBALS['DIC']->logger()->wsrv();
41
42 $this->container = $settingsContainer;
43 $this->server = ilECSSetting::getInstanceByServerId($server_id);
44 $this->mid = $mid;
45 $this->lng = $lng;
46 $this->lng->loadLanguageModule('ecs');
47 $this->ctrl = $ilCtrl;
48 }
49
54 public function getContainer()
55 {
56 return $this->container;
57 }
58
63 public function getServer()
64 {
65 return $this->server;
66 }
67
72 public function getMid()
73 {
74 return $this->mid;
75 }
76
80 public function executeCommand()
81 {
82 global $ilCtrl;
83
84 $GLOBALS['tpl']->setTitle($this->lng->txt('ecs_campus_connect_title'));
85
86 $this->ctrl->saveParameter($this, 'server_id');
87 $this->ctrl->saveParameter($this, 'mid');
88 $this->ctrl->saveParameter($this, 'tid');
89
90 $next_class = $this->ctrl->getNextClass($this);
91 $cmd = $this->ctrl->getCmd();
92
93 $this->setTabs();
94 switch ($next_class) {
95 default:
96 if (!$cmd) {
97 $cmd = "cStart";
98 }
99 $this->$cmd();
100 break;
101 }
102
103 $GLOBALS['tpl']->setTitle($this->getServer()->getTitle());
104 $GLOBALS['tpl']->setDescription('');
105
106 return true;
107 }
108
112 public function cancel()
113 {
114 $GLOBALS['ilCtrl']->returnToParent($this);
115 }
116
117
118
119
120
121
126 protected function cStart()
127 {
128 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
129 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()) {
130 return $this->cInitOverview();
131 }
132 return $this->cSettings();
133 }
134
139 protected function dStart()
140 {
141 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
142 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled()) {
143 return $this->dTrees();
144 }
145 return $this->dSettings();
146 }
147
151 protected function cInitOverview($form = null, $current_attribute = null)
152 {
153 global $ilTabs;
154
155 $current_node = (array) (($_REQUEST['lnodes']) ? $_REQUEST['lnodes'] : ROOT_FOLDER_ID);
156 $current_node = end($current_node);
157
158 $this->ctrl->setParameter($this, 'lnodes', $current_node);
159
160 $this->setSubTabs(self::TAB_COURSE);
161 $ilTabs->activateTab('ecs_crs_allocation');
162 $ilTabs->activateSubTab('cInitTree');
163
164 $GLOBALS['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 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
169 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
170
171 if ($current_attribute === null) {
172 // check request
173 $current_attribute = (string) $_REQUEST['ecs_ca'];
174 if (!$current_attribute) {
176 $this->getServer()->getServerId(),
177 $this->getMid(),
178 $current_node
179 );
180
181 $current_attribute =
182 $existing ?
183 $existing :
184 '';
185 /*
186 ilECSCourseAttributes::getInstance(
187 $this->getServer()->getServerId(),
188 $this->getMid())->getFirstAttributeName()
189 );
190 */
191 }
192 }
193 $form = $this->cInitMappingForm($current_node, $current_attribute);
194 }
195
196 $GLOBALS['tpl']->setVariable('TFORM_ACTION', $this->ctrl->getFormAction($this));
197 $GLOBALS['tpl']->setVariable('LOCAL_EXPLORER', $explorer->getOutput());
198 $GLOBALS['tpl']->setVariable('MAPPING_FORM', $form->getHTML());
199 }
200
204 protected function cAddAttribute()
205 {
206 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
207 $next_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getNextAttributeName((string) $_REQUEST['ecs_ca']);
208 $this->cInitOverview(null, $next_attribute);
209 }
210
214 protected function cDeleteAttribute()
215 {
216 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
217 $prev_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getPreviousAttributeName((string) $_REQUEST['ecs_ca']);
218 $this->cInitOverview(null, $prev_attribute);
219 }
220
224 protected function cShowLocalExplorer()
225 {
226 global $tree;
227
228 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
229 $explorer = new ilECSNodeMappingLocalExplorer(
230 $this->ctrl->getLinkTarget($this, 'cInitOverview'),
231 $this->getServer()->getServerId(),
232 $this->getMid()
233 );
234 $explorer->setPostVar('lnodes[]');
235
236 $lnodes = (array) $_REQUEST['lnodes'];
237 $checked_node = array_pop($lnodes);
238 if ((int) $_REQUEST['lid']) {
239 $checked_node = (int) $_REQUEST['lid'];
240 }
241
242 if ($checked_node) {
243 $explorer->setCheckedItems(array($checked_node));
244 } else {
245 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
246 }
247 $explorer->setTargetGet('lref_id');
248 $explorer->setSessionExpandVariable('lexpand');
249 $explorer->setExpand((int) $_GET['lexpand']);
250 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'cInitOverview'));
251 $explorer->setOutput(0);
252 return $explorer;
253 }
254
258 protected function cInitMappingForm($current_node, $current_attribute)
259 {
260 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
261 $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
262
263 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
264 $form = new ilPropertyFormGUI();
265 $form->setTableWidth("100%");
266 $this->ctrl->setParameter($this, 'ecs_ca', $current_attribute);
267 $form->setFormAction($this->ctrl->getFormAction($this));
268 $this->ctrl->setParameter($this, 'ecs_ca', '');
269
270 $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') . ' ' . ilObject::_lookupTitle(ilObject::_lookupObjId($current_node)));
271
272 // Iterate through all current attributes
273 $attributes = $attributes_obj->getAttributeSequence($current_attribute);
274 foreach ($attributes as $att_name) {
275 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
276 $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name);
277
279 $section->setTitle($this->lng->txt('ecs_cmap_att_' . $att_name));
280
281 // Filter
282 $form->addItem($section);
283
284 $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'), $att_name . '_is_filter');
285 $isfilter->setValue($rule->isFilterEnabled() ? 1 : 0);
286
287 $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'), 0);
288 $isfilter->addOption($all_values);
289
290 $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'), 1);
291 $filter = new ilTextInputGUI('', $att_name . '_filter');
292 $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info'));
293 $filter->setSize(50);
294 $filter->setMaxLength(512);
295 $filter->setRequired(true);
296 $filter->setValue($rule->getFilter());
297 $use_filter->addSubItem($filter);
298
299 $isfilter->addOption($use_filter);
300
301 $form->addItem($isfilter);
302
303 // Create subdirs
304 $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'), $att_name . '_subdirs');
305 $subdirs->setChecked($rule->isSubdirCreationEnabled());
306 $subdirs->setValue(1);
307
308 // Subdir types (disabled in spec)
309 /*
310 $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type');
311 $subdir_type->setValue($rule->getSubDirectoryType());
312
313 $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'), ilECSCourseMappingRule::SUBDIR_VALUE);
314 $subdir_type->addOption($value);
315
316 $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'), ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME);
317 $subdir_type->addOption($name);
318
319 $subdirs->addSubItem($subdir_type);
320 */
321 $form->addItem($subdirs);
322
323 // Directory relations
324 /*
325 $upper_attributes = ilECSCourseAttributes::getInstance(
326 $this->getServer()->getServerId(),
327 $this->getMid())->getUpperAttributes($att_name);
328
329 if($upper_attributes)
330 {
331 $dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation');
332
333 $current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),'');
334 $dir_relation->addOption($current_dir);
335 }
336 foreach($upper_attributes as $subdir_name)
337 {
338 $subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name);
339 $dir_relation->addOption($subdir);
340 }
341 if($upper_attributes)
342 {
343 $dir_relation->setValue((string) $rule->getDirectory());
344 $form->addItem($dir_relation);
345 }
346 */
347 }
348
349 // add list of attributes
350 $hidden_atts = new ilHiddenInputGUI('attributes');
351 $hidden_atts->setValue(implode(',', $attributes));
352 $form->addItem($hidden_atts);
353
354
355 if ($current_attribute) {
356 $form->addCommandButton('cSaveOverview', $this->lng->txt('save'));
357 }
358
359 if ($attributes_obj->getNextAttributeName($current_attribute)) {
360 $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn'));
361 }
362 if ($attributes_obj->getPreviousAttributeName($current_attribute)) {
363 $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn'));
364 }
366 $this->getServer()->getServerId(),
367 $this->getMid(),
368 $current_node
369 )) {
370 $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule'));
371 }
372
373 #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel'));
374
375 $form->setShowTopButtons(false);
376
377 return $form;
378 }
379
383 protected function cSaveOverview()
384 {
385 $current_node = (int) $_REQUEST['lnodes'];
386 $current_att = (string) $_REQUEST['ecs_ca'];
387 $form = $this->cInitMappingForm($current_node, $current_att);
388
389 if ($form->checkInput()) {
390 // save ...
391 $all_attributes = explode(',', $form->getInput('attributes'));
392 foreach ((array) $all_attributes as $att_name) {
394 $this->getServer()->getServerId(),
395 $this->getMid(),
396 $current_node,
397 $att_name
398 );
399 $rule->setServerId($this->getServer()->getServerId());
400 $rule->setMid($this->getMid());
401 $rule->setRefId($current_node);
402 $rule->setAttribute($att_name);
403 $rule->enableFilter($form->getInput($att_name . '_is_filter'));
404 $rule->setFilter($form->getInput($att_name . '_filter'));
405 $rule->enableSubdirCreation($form->getInput($att_name . '_subdirs'));
406 //$rule->setSubDirectoryType($form->getInput($att_name.'_subdir_type'));
407 //$rule->setDirectory($form->getInput($att_name.'_dir_relation'));
408
409 if ($rule->getRuleId()) {
410 $rule->update();
411 } else {
412 $rule->save();
413 }
414 }
415
416 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
417 $this->ctrl->setParameter($this, 'lnodes', $current_node);
418 $this->ctrl->redirect($this, 'cInitOverview');
419 }
420
421 $form->setValuesByPost();
422 ilUtil::sendFailure($this->lng->txt('err_check_input'));
423 $this->cInitOverview($form, $current_att);
424 }
425
426 protected function cDeleteRulesOfNode()
427 {
428 $current_node = (int) $_REQUEST['lnodes'];
429
430 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
432 $this->getServer()->getServerId(),
433 $this->getMid(),
434 $current_node
435 );
436
437 foreach ($rules as $rid) {
438 $rule = new ilECSCourseMappingRule($rid);
439 $rule->delete();
440 }
441 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
442 $this->ctrl->redirect($this, 'cInitOverview');
443 }
444
445
446
447
453 protected function cSettings(ilPropertyFormGUI $form = null)
454 {
455 global $ilTabs;
456
457 $this->setSubTabs(self::TAB_COURSE);
458 $ilTabs->activateTab('ecs_crs_allocation');
459 $ilTabs->activateSubTab('cSettings');
460
461 if (!$form instanceof ilPropertyFormGUI) {
462 $form = $this->initFormCSettings();
463 }
464
465 $GLOBALS['tpl']->setContent($form->getHTML());
466
467 return true;
468 }
469
473 protected function initFormCSettings()
474 {
475 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
476
477 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
478 $form = new ilPropertyFormGUI();
479 $form->setFormAction($this->ctrl->getFormAction($this));
480 $form->setTitle($this->lng->txt('settings'));
481
482 // individual course allocation
483 $check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled');
484 $check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled());
485 $form->addItem($check);
486
487
488 // add default container
489 $imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'), 'default_cat');
490 $imp->setRequired(true);
491
492 $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
493 $tpl->setVariable('SIZE', 5);
494 $tpl->setVariable('MAXLENGTH', 11);
495 $tpl->setVariable('POST_VAR', 'default_cat');
496
497 $default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getDefaultCourseCategory();
498 $tpl->setVariable('PROPERTY_VALUE', $default);
499
500 if ($default) {
501 include_once './Services/Tree/classes/class.ilPathGUI.php';
502 $path = new ilPathGUI();
503 $path->enableTextOnly(false);
504 $path->enableHideLeaf(false);
505 $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
506 }
507
508 $imp->setHtml($tpl->get());
509 $imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info'));
510 $form->addItem($imp);
511
512 // all in one category
513 $allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'), 'allinone');
514 $allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAllInOneCategoryEnabled());
515 $allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info'));
516
517 $allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'), 'allinone_cat');
518 $allinone_cat->setRequired(true);
519
520 $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
521 $tpl->setVariable('SIZE', 5);
522 $tpl->setVariable('MAXLENGTH', 11);
523 $tpl->setVariable('POST_VAR', 'allinone_cat');
524
525 $cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAllInOneCategory();
526 $tpl->setVariable('PROPERTY_VALUE', $cat);
527 if ($cat) {
528 include_once './Services/Tree/classes/class.ilPathGUI.php';
529 $path = new ilPathGUI();
530 $path->enableTextOnly(false);
531 $path->enableHideLeaf(false);
532 $tpl->setVariable('COMPLETE_PATH', $path->getPath(ROOT_FOLDER_ID, $default));
533 }
534
535 $allinone_cat->setHtml($tpl->get());
536 $allinone->addSubItem($allinone_cat);
537 $form->addItem($allinone);
538
539 // multiple attributes
540 $multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'), 'multiple');
541 $multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isAttributeMappingEnabled());
542
543 // attribute selection
544 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
545 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
546 $attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'), 'atts');
547 $attributes->setMulti(true);
548 $attributes->setValue(
550 $this->getServer()->getServerId(),
551 $this->getMid()
552 )->getAttributeValues()
553 );
554 $attributes->setRequired(true);
556 $multiple->addSubItem($attributes);
557
558 $form->addItem($multiple);
559
560 // role mapping
561 $rm = new ilFormSectionHeaderGUI();
562 $rm->setTitle($this->lng->txt('ecs_role_mappings'));
563 $form->addItem($rm);
564
565 // auth type
566 $auth_type = new ilSelectInputGUI($this->lng->txt('ecs_member_auth_type'), 'auth_mode');
567 $auth_type->setOptions(ilECSMappingUtils::getAuthModeSelection());
568 $auth_type->setRequired(true);
569 $auth_type->setValue(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAuthMode());
570 $form->addItem($auth_type);
571
572 $mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getRoleMappings();
573
574 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
576 $role_map = new ilTextInputGUI($this->lng->txt($info['lang']), $name);
577 $role_map->setValue($mapping_defs[$name]);
578 $role_map->setSize(32);
579 $role_map->setMaxLength(64);
580 $role_map->setRequired($info['required']);
581 $form->addItem($role_map);
582 }
583
584 $form->addCommandButton('cUpdateSettings', $this->lng->txt('save'));
585 $form->addCommandButton('cSettings', $this->lng->txt('cancel'));
586
587 return $form;
588 }
589
594 protected function dSettings(ilPropertyFormGUI $form = null)
595 {
596 global $ilTabs;
597
598 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
599 $this->setSubTabs(self::TAB_DIRECTORY);
600 $ilTabs->activateTab('ecs_dir_allocation');
601 $ilTabs->activateSubTab('dSettings');
602
603 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
604 if (!$form instanceof ilPropertyFormGUI) {
605 $form = $this->initFormDSettings();
606 }
607
608 $GLOBALS['tpl']->setContent($form->getHTML());
609
610 return true;
611 }
612
616 protected function cUpdateSettings()
617 {
618 $form = $this->initFormCSettings();
619 if ($form->checkInput()) {
620 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
621 $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid());
622 $settings->enableCourseAllocation($form->getInput('enabled'));
623 $settings->setDefaultCourseCategory($form->getInput('default_cat'));
624 $settings->enableAllInOne($form->getInput('allinone'));
625 $settings->setAllInOneCategory($form->getInput('allinone_cat'));
626 $settings->enableAttributeMapping($form->getInput('multiple'));
627 $settings->setAuthMode($form->getInput('auth_mode'));
628
629
630 $role_mappings = array();
632 $role_mappings[$name] = $form->getInput($name);
633 }
634 $settings->setRoleMappings($role_mappings);
635 $settings->update();
636
637 // store attribute settings
638 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
639 $attributes = new ilECSCourseAttributes($this->getServer()->getServerId(), $this->getMid());
640 $attributes->delete();
641
642 $form_atts = $form->getInput('atts');
643
644 foreach ($form_atts as $name) {
645 if (!$name) {
646 continue;
647 }
648
649 $att = new ilECSCourseAttribute();
650 $att->setServerId($this->getServer()->getServerId());
651 $att->setMid($this->getMid());
652 $att->setName($name);
653 $att->save();
654 }
655
656 //$att = new ilECSCourseAttribute();
657 //$att->setName($a_name)
658
659 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
660 $GLOBALS['ilCtrl']->redirect($this, 'cSettings');
661 }
662 ilUtil::sendFailure($this->lng->txt('err_check_input'));
663 $form->setValuesByPost();
664 $this->cSettings($form);
665 }
666
671 protected function cAttributes()
672 {
673 global $ilTabs;
674
675 $this->setSubTabs(self::TAB_COURSE);
676 $ilTabs->setTabActive('ecs_crs_allocation');
677 $ilTabs->setSubTabActive('cAttributes');
678
679 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributesTableGUI.php';
680 $table = new ilECSCourseAttributesTableGUI(
681 $this,
682 'attributes',
683 $this->getServer()->getServerId(),
684 $this->getMid()
685 );
686 $table->init();
687 $table->parse(
689 $this->getServer()->getServerId(),
690 $this->getMid()
691 )->getAttributes()
692 );
693
694 $GLOBALS['tpl']->setContent($table->getHTML());
695 }
696
697
698
702 protected function dUpdateSettings()
703 {
704 global $ilCtrl;
705
706 $form = $this->initFormDSettings();
707 if ($form->checkInput()) {
708 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
709 $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid());
710 $settings->enableDirectoryMapping((bool) $form->getInput('active'));
711 $settings->enableEmptyContainerCreation(!$form->getInput('empty'));
712 $settings->update();
713 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
714 } else {
715 ilUtil::sendFailure($this->lng->txt('err_check_input'), true);
716 $form->setValuesByPost();
717 }
718 $ilCtrl->redirect($this, 'dSettings');
719 }
720
724 protected function initFormDSettings()
725 {
726 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
727 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
728
729 $form = new ilPropertyFormGUI();
730 $form->setFormAction($this->ctrl->getFormAction($this));
731 $form->setTitle($this->lng->txt('general_settings'));
732
733 $active = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_activate'), 'active');
734 $active->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled());
735 $form->addItem($active);
736
737 $create_empty = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_create_empty'), 'empty');
738 $create_empty->setChecked(!ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isEmptyContainerCreationEnabled());
739 $create_empty->setInfo($this->lng->txt('ecs_node_mapping_create_empty_info'));
740 $form->addItem($create_empty);
741
742 $form->addCommandButton('dUpdateSettings', $this->lng->txt('save'));
743 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
744
745 return $form;
746 }
747
751 protected function dTrees()
752 {
753 global $ilToolbar;
754
755 $this->setSubTabs(self::TAB_DIRECTORY);
756 $GLOBALS['ilTabs']->activateSubTab('dTrees');
757 $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
758
759 $ilToolbar->addButton(
760 $this->lng->txt('ecs_sync_trees'),
761 $this->ctrl->getLinkTarget($this, 'dSynchronizeTrees')
762 );
763
764 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingTreeTableGUI.php';
765
766 $dtreeTable = new ilECSNodeMappingTreeTableGUI(
767 $this->getServer()->getServerId(),
768 $this->getMid(),
769 $this,
770 'dtree'
771 );
772
773
774 $dtreeTable->parse();
775 $GLOBALS['tpl']->setContent($dtreeTable->getHTML());
776 return true;
777 }
778
782 protected function dConfirmDeleteTree()
783 {
784 $this->setSubTabs(self::TAB_DIRECTORY);
785 $GLOBALS['ilTabs']->activateSubTab('dTrees');
786 $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
787
788 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
789 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
790
791 $confirm = new ilConfirmationGUI();
792 $confirm->setFormAction($this->ctrl->getFormAction($this));
793 $confirm->setHeaderText($this->lng->txt('ecs_confirm_delete_tree'));
794
795 $confirm->addItem(
796 'tid',
797 (int) $_REQUEST['tid'],
799 $this->getServer()->getServerId(),
800 $this->getMid(),
801 (int) $_REQUEST['tid']
802 )
803 );
804 $confirm->setConfirm($this->lng->txt('delete'), 'dDeleteTree');
805 $confirm->setCancel($this->lng->txt('cancel'), 'dTrees');
806
807 $GLOBALS['tpl']->setContent($confirm->getHTML());
808 }
809
813 protected function dDeleteTree()
814 {
815 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
816 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
817
818 $GLOBALS['ilLog']->write('Deleting tree');
819
820 $tree = new ilECSCmsTree((int) $_REQUEST['tid']);
821 $tree->deleteTree($tree->getNodeData(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
822
823
824
825 // also delete import information
826 include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
828 $this->getServer()->getServerId(),
829 $this->getMid(),
831 $this->getServer()->getServerId(),
832 $this->getMid(),
833 (int) $_REQUEST['tid']
834 )
835 );
836
837 $data = new ilECSCmsData();
838 $data->setServerId($this->getServer()->getServerId());
839 $data->setMid($this->getMid());
840 $data->setTreeId((int) $_REQUEST['tid']);
841 $data->deleteTree();
842
843
844 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
846 $this->getServer()->getServerId(),
847 $this->getMid(),
848 (int) $_REQUEST['tid']
849 );
850
851 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_deleted'), true);
852 $this->ctrl->redirect($this, 'dTrees');
853 }
854
858 protected function dEditTree(ilPropertyFormGUI $form = null)
859 {
860 $GLOBALS['tpl']->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ecs_edit_tree.html', 'Services/WebServices/ECS');
861
862 $this->ctrl->saveParameter($this, 'cid');
863
864 $GLOBALS['ilTabs']->clearTargets();
865 $GLOBALS['ilTabs']->setBack2Target(
866 $this->lng->txt('ecs_back_settings'),
867 $this->ctrl->getLinkTarget($this, 'cancel')
868 );
869 $GLOBALS['ilTabs']->setBackTarget(
870 $this->lng->txt('ecs_cms_dir_tree'),
871 $this->ctrl->getLinkTarget($this, 'dTrees')
872 );
873
874 $GLOBALS['tpl']->setVariable('LEGEND', $GLOBALS['lng']->txt('ecs_status_legend'));
875 $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED', $GLOBALS['lng']->txt('ecs_status_pending_unmapped'));
876 $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED_DISCON', $GLOBALS['lng']->txt('ecs_status_pending_unmapped_discon'));
877 $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED_NONDISCON', $GLOBALS['lng']->txt('ecs_status_pending_unmapped_nondiscon'));
878 $GLOBALS['tpl']->setVariable('MAPPED', $GLOBALS['lng']->txt('ecs_status_mapped'));
879 $GLOBALS['tpl']->setVariable('DELETED', $GLOBALS['lng']->txt('ecs_status_deleted'));
880
882 $GLOBALS['tpl']->setVariable('GENERAL_FORM', $form->getHTML());
883 $GLOBALS['tpl']->setVariable('TFORM_ACTION', $this->ctrl->getFormAction($this, 'dEditTree'));
884
885 $explorer = $this->dShowLocalExplorer();
886 $this->dShowCmsExplorer($explorer);
887 }
888
893 {
894 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
895 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
896
897 if ($form instanceof ilPropertyFormGUI) {
898 return $form;
899 }
900
901 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
902 $assignment = new ilECSNodeMappingAssignment(
903 $this->getServer()->getServerId(),
904 $this->getMid(),
905 (int) $_REQUEST['tid'],
906 0
907 );
908
909 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
910 $form = new ilPropertyFormGUI();
911 $form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree'));
912 $form->setTitle($this->lng->txt('general_settings'));
913 $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
914 $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
915 $form->setTableWidth('30%');
916
917 // CMS id (readonly)
918 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
919 $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
920 $cmsid->setValue(
922 );
923 $cmsid->setDisabled(true);
924 $cmsid->setSize(7);
925 $cmsid->setMaxLength(12);
926 $form->addItem($cmsid);
927
928
930 $this->getServer()->getServerId(),
931 $this->getMid(),
932 (int) $_REQUEST['tid']
933 );
934 $mapping_advanced = ($mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false);
935
936 // Status (readonly)
937 $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
938 $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
939 $form->addItem($status);
940
941 // title update
942 $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
943 $title->setValue(1);
944 $title->setChecked($assignment->isTitleUpdateEnabled());
945 #$title->setInfo($this->lng->txt('ecs_title_update_info'));
946 $form->addItem($title);
947
948
949 $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
950 $position->setDisabled(!$mapping_advanced);
951 $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
952 $position->setValue(1);
953 #$position->setInfo($this->lng->txt('ecs_position_update_info'));
954 $form->addItem($position);
955
956 $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
957 $tree->setDisabled(!$mapping_advanced);
958 $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
959 $tree->setValue(1);
960 #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
961 $form->addItem($tree);
962
963 return $form;
964 }
965
970 protected function dUpdateTreeSettings()
971 {
972 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
973 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
974 $assignment = new ilECSNodeMappingAssignment(
975 $this->getServer()->getServerId(),
976 $this->getMid(),
977 (int) $_REQUEST['tid'],
978 0
979 );
980 $assignment->setRefId(0);
981 $assignment->setObjId(0);
982
983 $form = $this->dInitFormTreeSettings();
984 if ($form->checkInput()) {
985 $assignment->enableTitleUpdate($form->getInput('title'));
986 $assignment->enableTreeUpdate($form->getInput('tree'));
987 $assignment->enablePositionUpdate($form->getInput('position'));
988 $assignment->update();
989
990 ilUtil::sendSuccess($this->lng->txt('settings_saved', true));
991 $this->ctrl->redirect($this, 'dEditTree');
992 }
993
994 $form->setValuesByPost();
995 ilUtil::sendFailure($this->lng->txt('err_check_input'));
996 $this->dEditTree($form);
997 return true;
998 }
999
1003 protected function dSynchronizeTree()
1004 {
1005 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTreeSynchronizer.php';
1007 $this->getServer(),
1008 $this->mid,
1009 (int) $_REQUEST['tid']
1010 );
1011 $sync->sync();
1012 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_synchronized'), true);
1013 $this->ctrl->redirect($this, 'dTrees');
1014 }
1015
1016 protected function dSynchronizeTrees()
1017 {
1018 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
1019
1020 $this->log->dump('Start synchronizing cms directory trees');
1021
1022 try {
1023 $connector = new ilECSDirectoryTreeConnector($this->getServer());
1024 $res = $connector->getDirectoryTrees();
1025
1026 $this->log->dump($res, ilLogLevel::DEBUG);
1027
1028 foreach ((array) $res->getLinkIds() as $cms_id) {
1029 include_once './Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
1030 include_once './Services/WebServices/ECS/classes/class.ilECSEvent.php';
1031 $event = new ilECSEventQueueReader($this->getServer()->getServerId());
1032 $event->add(
1034 $cms_id,
1036 );
1037 }
1038 $this->ctrl->redirect($this, 'dTrees');
1039 } catch (Exception $e) {
1040 ilUtil::sendFailure($e->getMessage(), true);
1041 $this->ctrl->redirect($this, 'dTrees');
1042 }
1043 }
1044
1048 protected function dShowLocalExplorer()
1049 {
1050 global $tree;
1051
1052 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
1053 $explorer = new ilECSNodeMappingLocalExplorer(
1054 $this->ctrl->getLinkTarget($this, 'dEditTree'),
1055 $this->getServer()->getServerId(),
1056 $this->getMid()
1057 );
1058 $explorer->setPostVar('lnodes[]');
1059
1060 $lnodes = (array) $_REQUEST['lnodes'];
1061 $checked_node = array_pop($lnodes);
1062 if ((int) $_REQUEST['lid']) {
1063 $checked_node = (int) $_REQUEST['lid'];
1064 }
1065
1066 if ($checked_node) {
1067 $explorer->setCheckedItems(array($checked_node));
1068 } else {
1069 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
1070 }
1071 $explorer->setTargetGet('lref_id');
1072 $explorer->setSessionExpandVariable('lexpand');
1073 $explorer->setExpand((int) $_GET['lexpand']);
1074 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'dEditTree'));
1075 $explorer->setOutput(0);
1076 $GLOBALS['tpl']->setVariable('LOCAL_EXPLORER', $explorer->getOutput());
1077
1078 return $explorer;
1079 }
1080
1084 protected function dShowCmsExplorer(ilExplorer $localExplorer)
1085 {
1086 global $tree;
1087
1088 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1089 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingCmsExplorer.php';
1090 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1091
1092 $explorer = new ilECSNodeMappingCmsExplorer(
1093 $this->ctrl->getLinkTarget($this, 'dEditTree'),
1094 $this->getServer()->getServerId(),
1095 $this->getMid(),
1096 (int) $_REQUEST['tid']
1097 );
1098 $explorer->setRoot(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid']));
1099 $explorer->setTree(
1100 new ilECSCmsTree(
1101 (int) $_REQUEST['tid']
1102 )
1103 );
1104 $explorer->setPostVar('rnodes[]');
1105
1106 // Read checked items from mapping of checked items in local explorer
1107 $active_node = $tree->getRootId();
1108 foreach ($localExplorer->getCheckedItems() as $ref_id) {
1109 $explorer->setCheckedItems(
1111 $this->getServer()->getServerId(),
1112 $this->getMid(),
1113 (int) $_REQUEST['tid'],
1114 $ref_id
1115 )
1116 );
1117 $active_node = $ref_id;
1118 }
1119
1120
1121 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1122 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1123 $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1125 $this->getServer()->getServerId(),
1126 $this->getMid(),
1127 (int) $_REQUEST['tid'],
1128 $active_node
1129 ) as $cs_id) {
1130 foreach ($cmsTree->getPathId($cs_id) as $path_id) {
1131 #$explorer->setExpand($path_id);
1132 }
1133 }
1134
1135 $explorer->setTargetGet('rref_id');
1136 $explorer->setSessionExpandVariable('rexpand');
1137
1138 #if((int) $_REQUEST['rexpand'])
1139 {
1140 $explorer->setExpand((int) $_GET['rexpand']);
1141 }
1142 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'dEditTree'));
1143 $explorer->setOutput(0);
1144 $GLOBALS['tpl']->setVariable('REMOTE_EXPLORER', $explorer->getOutput());
1145 }
1146
1151 protected function dInitEditTree()
1152 {
1153 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
1155 $this->getServer()->getServerId(),
1156 $this->getMid(),
1157 (int) $_REQUEST['tid']
1158 );
1159 return $this->dEditTree();
1160 }
1161
1162
1166 protected function dMap()
1167 {
1168 if (!$_POST['lnodes']) {
1169 ilUtil::sendFailure($this->lng->txt('select_one'), true);
1170 $this->ctrl->redirect($this, 'dEditTree');
1171 }
1172
1173 $ref_id = end($_POST['lnodes']);
1174
1175 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1177 $this->getServer()->getServerId(),
1178 $this->getMid(),
1179 (int) $_REQUEST['tid'],
1180 $ref_id
1181 );
1182
1183
1184 $nodes = (array) $_POST['rnodes'];
1185 $nodes = (array) array_reverse($nodes);
1186
1187 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
1188 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1189 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1190 foreach ($nodes as $cms_id) {
1191 $assignment = new ilECSNodeMappingAssignment(
1192 $this->getServer()->getServerId(),
1193 $this->getMid(),
1194 (int) $_REQUEST['tid'],
1195 (int) $cms_id
1196 );
1197 $assignment->setRefId($ref_id);
1198 $assignment->setObjId(ilObject::_lookupObjId($ref_id));
1199 $assignment->enablePositionUpdate(false);
1200 $assignment->enableTreeUpdate(false);
1201 $assignment->enableTitleUpdate(ilECSNodeMappingAssignments::lookupDefaultTitleUpdate(
1202 $this->getServer()->getServerId(),
1203 $this->getMid(),
1204 (int) $_REQUEST['tid']
1205 ));
1206 $assignment->update();
1207
1208 // Delete subitems mappings for cms subtree
1209 $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1210 $childs = $cmsTree->getSubTreeIds($cms_id);
1211
1213 $this->getServer()->getServerId(),
1214 $this->getMid(),
1215 (int) $_REQUEST['tid'],
1216 $childs
1217 );
1218 }
1219
1221 $this->getServer()->getServerId(),
1222 $this->getMid(),
1223 (int) $_REQUEST['tid']
1224 );
1225
1226 // Save parameter cid
1227 $this->ctrl->setParameter($this, 'lid', (int) $ref_id);
1228
1229 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1230 $this->ctrl->redirect($this, 'dEditTree');
1231 }
1232
1236 protected function dMappingOverview()
1237 {
1238 $this->setSubTabs(self::TAB_DIRECTORY);
1239 $GLOBALS['ilTabs']->activateSubTab('dMappingOverview');
1240 $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
1241 }
1242
1243
1244
1249 protected function setTabs()
1250 {
1251 global $ilTabs;
1252
1253 include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
1254
1255 $ilTabs->clearTargets();
1256 $ilTabs->setBackTarget(
1257 $this->lng->txt('ecs_back_settings'),
1258 $this->ctrl->getParentReturn($this)
1259 );
1260 // Directories are only visible for import type campus managment.
1261 if (ilECSParticipantSettings::loookupCmsMid($this->getServer()->getServerId()) == $this->getMid()) {
1262 $ilTabs->addTab(
1263 'ecs_dir_allocation',
1264 $this->lng->txt('ecs_dir_alloc'),
1265 $this->ctrl->getLinkTarget($this, 'dSettings')
1266 );
1267 }
1268
1269 $ilTabs->addTab(
1270 'ecs_crs_allocation',
1271 $this->lng->txt('ecs_crs_alloc'),
1272 $this->ctrl->getLinkTarget($this, 'cStart')
1273 );
1274 }
1275
1281 protected function setSubTabs($a_tab)
1282 {
1283 global $ilTabs;
1284
1285 if ($a_tab == self::TAB_DIRECTORY) {
1286 $ilTabs->addSubTab(
1287 'dMappingOverview',
1288 $this->lng->txt('ecs_cc_mapping_overview'),
1289 $this->ctrl->getLinkTarget($this, 'dMappingOverview')
1290 );
1291 $ilTabs->addSubTab(
1292 'dTrees',
1293 $this->lng->txt('ecs_cms_dir_tree'),
1294 $this->ctrl->getLinkTarget($this, 'dTrees')
1295 );
1296 $ilTabs->addSubTab(
1297 'dSettings',
1298 $this->lng->txt('settings'),
1299 $this->ctrl->getLinkTarget($this, 'dSettings')
1300 );
1301 }
1302 if ($a_tab == self::TAB_COURSE) {
1303 // Check if attributes are available
1304 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
1305 $atts = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
1306
1307 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
1308 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()) {
1309 $ilTabs->addSubTab(
1310 'cInitTree',
1311 $this->lng->txt('ecs_cmap_overview'),
1312 $this->ctrl->getLinkTarget($this, 'cInitOverview')
1313 );
1314 }
1315
1316 $ilTabs->addSubTab(
1317 'cSettings',
1318 $this->lng->txt('settings'),
1319 $this->ctrl->getLinkTarget($this, 'cSettings')
1320 );
1321 }
1322 }
1323}
$tpl
Definition: ilias.php:10
$section
Definition: Utf8Test.php:83
$_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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
if($format !==null) $name
Definition: metadata.php:146
$info
Definition: index.php:5
$sync
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form
foreach($_POST as $key=> $value) $res
$attributes
$rule
Definition: showstats.php:43