ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
4 include_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  {
96  default:
97  if(!$cmd)
98  {
99  $cmd = "cStart";
100  }
101  $this->$cmd();
102  break;
103  }
104 
105  $GLOBALS['tpl']->setTitle($this->getServer()->getTitle());
106  $GLOBALS['tpl']->setDescription('');
107 
108  return true;
109  }
110 
114  public function cancel()
115  {
116  $GLOBALS['ilCtrl']->returnToParent($this);
117  }
118 
119 
120 
121 
122 
123 
128  protected function cStart()
129  {
130  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
131  if(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isCourseAllocationEnabled())
132  {
133  return $this->cInitOverview();
134  }
135  return $this->cSettings();
136  }
137 
142  protected function dStart()
143  {
144  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
145  if(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isDirectoryMappingEnabled())
146  {
147  return $this->dTrees();
148  }
149  return $this->dSettings();
150  }
151 
155  protected function cInitOverview($form = null, $current_attribute = null)
156  {
157  global $ilTabs;
158 
159  $current_node = (array) (($_REQUEST['lnodes']) ? $_REQUEST['lnodes'] : ROOT_FOLDER_ID);
160  $current_node = end($current_node);
161 
162  $this->ctrl->setParameter($this,'lnodes',$current_node);
163 
164  $this->setSubTabs(self::TAB_COURSE);
165  $ilTabs->activateTab('ecs_crs_allocation');
166  $ilTabs->activateSubTab('cInitTree');
167 
168  $GLOBALS['tpl']->addBlockFile('ADM_CONTENT','adm_content','tpl.ecs_cmap_overview.html','Services/WebServices/ECS');
169 
170  $explorer = $this->cShowLocalExplorer();
171  if(!$form instanceof ilPropertyFormGUI)
172  {
173  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
174  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
175 
176  if($current_attribute === null)
177  {
178  // check request
179  $current_attribute = (string) $_REQUEST['ecs_ca'];
180  if(!$current_attribute)
181  {
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['tpl']->setVariable('TFORM_ACTION',$this->ctrl->getFormAction($this));
204  $GLOBALS['tpl']->setVariable('LOCAL_EXPLORER',$explorer->getOutput());
205  $GLOBALS['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 $tree;
234 
235  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
236  $explorer = new ilECSNodeMappingLocalExplorer(
237  $this->ctrl->getLinkTarget($this,'cInitOverview'),
238  $this->getServer()->getServerId(),
239  $this->getMid()
240  );
241  $explorer->setPostVar('lnodes[]');
242 
243  $lnodes = (array) $_REQUEST['lnodes'];
244  $checked_node = array_pop($lnodes);
245  if((int) $_REQUEST['lid'])
246  {
247  $checked_node = (int) $_REQUEST['lid'];
248  }
249 
250  if($checked_node)
251  {
252  $explorer->setCheckedItems(array($checked_node));
253  }
254  else
255  {
256  $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
257  }
258  $explorer->setTargetGet('lref_id');
259  $explorer->setSessionExpandVariable('lexpand');
260  $explorer->setExpand((int) $_GET['lexpand']);
261  $explorer->setExpandTarget($this->ctrl->getLinkTarget($this,'cInitOverview'));
262  $explorer->setOutput(0);
263  return $explorer;
264  }
265 
269  protected function cInitMappingForm($current_node,$current_attribute)
270  {
271  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
272  $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
273 
274  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
275  $form = new ilPropertyFormGUI();
276  $form->setTableWidth("100%");
277  $this->ctrl->setParameter($this,'ecs_ca',$current_attribute);
278  $form->setFormAction($this->ctrl->getFormAction($this));
279  $this->ctrl->setParameter($this,'ecs_ca','');
280 
281  $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') .' '.ilObject::_lookupTitle(ilObject::_lookupObjId($current_node)));
282 
283  // Iterate through all current attributes
284  $attributes = $attributes_obj->getAttributeSequence($current_attribute);
285  foreach($attributes as $att_name)
286  {
287  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
288  $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name);
289 
291  $section->setTitle($this->lng->txt('ecs_cmap_att_'.$att_name));
292 
293  // Filter
294  $form->addItem($section);
295 
296  $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'),$att_name.'_is_filter');
297  $isfilter->setValue($rule->isFilterEnabled() ? 1 : 0);
298 
299  $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'),0);
300  $isfilter->addOption($all_values);
301 
302  $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'),1);
303  $filter = new ilTextInputGUI('',$att_name.'_filter');
304  $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info'));
305  $filter->setSize(50);
306  $filter->setMaxLength(512);
307  $filter->setRequired(true);
308  $filter->setValue($rule->getFilter());
309  $use_filter->addSubItem($filter);
310 
311  $isfilter->addOption($use_filter);
312 
313  $form->addItem($isfilter);
314 
315  // Create subdirs
316  $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'),$att_name.'_subdirs');
317  $subdirs->setChecked($rule->isSubdirCreationEnabled());
318  $subdirs->setValue(1);
319 
320  // Subdir types (disabled in spec)
321  /*
322  $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type');
323  $subdir_type->setValue($rule->getSubDirectoryType());
324 
325  $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'), ilECSCourseMappingRule::SUBDIR_VALUE);
326  $subdir_type->addOption($value);
327 
328  $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'), ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME);
329  $subdir_type->addOption($name);
330 
331  $subdirs->addSubItem($subdir_type);
332  */
333  $form->addItem($subdirs);
334 
335  // Directory relations
336  /*
337  $upper_attributes = ilECSCourseAttributes::getInstance(
338  $this->getServer()->getServerId(),
339  $this->getMid())->getUpperAttributes($att_name);
340 
341  if($upper_attributes)
342  {
343  $dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation');
344 
345  $current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),'');
346  $dir_relation->addOption($current_dir);
347  }
348  foreach($upper_attributes as $subdir_name)
349  {
350  $subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name);
351  $dir_relation->addOption($subdir);
352  }
353  if($upper_attributes)
354  {
355  $dir_relation->setValue((string) $rule->getDirectory());
356  $form->addItem($dir_relation);
357  }
358  */
359  }
360 
361  // add list of attributes
362  $hidden_atts = new ilHiddenInputGUI('attributes');
363  $hidden_atts->setValue(implode(',',$attributes));
364  $form->addItem($hidden_atts);
365 
366 
367  if($current_attribute)
368  {
369  $form->addCommandButton('cSaveOverview',$this->lng->txt('save'));
370  }
371 
372  if($attributes_obj->getNextAttributeName($current_attribute))
373  {
374  $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn'));
375  }
376  if($attributes_obj->getPreviousAttributeName($current_attribute))
377  {
378  $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn'));
379  }
381  $this->getServer()->getServerId(),
382  $this->getMid(),
383  $current_node
384  ))
385  {
386  $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule'));
387  }
388 
389  #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel'));
390 
391  $form->setShowTopButtons(false);
392 
393  return $form;
394  }
395 
399  protected function cSaveOverview()
400  {
401  $current_node = (int) $_REQUEST['lnodes'];
402  $current_att = (string) $_REQUEST['ecs_ca'];
403  $form = $this->cInitMappingForm($current_node, $current_att);
404 
405  if($form->checkInput())
406  {
407  // save ...
408  $all_attributes = explode(',',$form->getInput('attributes'));
409  foreach((array) $all_attributes as $att_name)
410  {
412  $this->getServer()->getServerId(),
413  $this->getMid(),
414  $current_node,
415  $att_name);
416  $rule->setServerId($this->getServer()->getServerId());
417  $rule->setMid($this->getMid());
418  $rule->setRefId($current_node);
419  $rule->setAttribute($att_name);
420  $rule->enableFilter($form->getInput($att_name.'_is_filter'));
421  $rule->setFilter($form->getInput($att_name.'_filter'));
422  $rule->enableSubdirCreation($form->getInput($att_name.'_subdirs'));
423  //$rule->setSubDirectoryType($form->getInput($att_name.'_subdir_type'));
424  //$rule->setDirectory($form->getInput($att_name.'_dir_relation'));
425 
426  if($rule->getRuleId())
427  {
428  $rule->update();
429  }
430  else
431  {
432  $rule->save();
433  }
434  }
435 
436  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
437  $this->ctrl->setParameter($this,'lnodes',$current_node);
438  $this->ctrl->redirect($this,'cInitOverview');
439  }
440 
441  $form->setValuesByPost();
442  ilUtil::sendFailure($this->lng->txt('err_check_input'));
443  $this->cInitOverview($form, $current_att);
444  }
445 
446  protected function cDeleteRulesOfNode()
447  {
448  $current_node = (int) $_REQUEST['lnodes'];
449 
450  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
452  $this->getServer()->getServerId(),
453  $this->getMid(),
454  $current_node);
455 
456  foreach($rules as $rid)
457  {
458  $rule = new ilECSCourseMappingRule($rid);
459  $rule->delete();
460  }
461  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
462  $this->ctrl->redirect($this,'cInitOverview');
463  }
464 
465 
466 
467 
473  protected function cSettings(ilPropertyFormGUI $form = NULL)
474  {
475  global $ilTabs;
476 
477  $this->setSubTabs(self::TAB_COURSE);
478  $ilTabs->activateTab('ecs_crs_allocation');
479  $ilTabs->activateSubTab('cSettings');
480 
481  if(!$form instanceof ilPropertyFormGUI)
482  {
483  $form = $this->initFormCSettings();
484  }
485 
486  $GLOBALS['tpl']->setContent($form->getHTML());
487 
488  return true;
489  }
490 
494  protected function initFormCSettings()
495  {
496  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
497 
498  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
499  $form = new ilPropertyFormGUI();
500  $form->setFormAction($this->ctrl->getFormAction($this));
501  $form->setTitle($this->lng->txt('settings'));
502 
503  // individual course allocation
504  $check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled');
505  $check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isCourseAllocationEnabled());
506  $form->addItem($check);
507 
508 
509  // add default container
510  $imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'),'default_cat');
511  $imp->setRequired(true);
512 
513  $tpl = new ilTemplate('tpl.ecs_import_id_form.html',true,true,'Services/WebServices/ECS');
514  $tpl->setVariable('SIZE',5);
515  $tpl->setVariable('MAXLENGTH',11);
516  $tpl->setVariable('POST_VAR','default_cat');
517 
518  $default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->getDefaultCourseCategory();
519  $tpl->setVariable('PROPERTY_VALUE',$default);
520 
521  if($default)
522  {
523  include_once './Services/Tree/classes/class.ilPathGUI.php';
524  $path = new ilPathGUI();
525  $path->enableTextOnly(false);
526  $path->enableHideLeaf(false);
527  $tpl->setVariable('COMPLETE_PATH',$path->getPath(ROOT_FOLDER_ID, $default));
528  }
529 
530  $imp->setHtml($tpl->get());
531  $imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info'));
532  $form->addItem($imp);
533 
534  // all in one category
535  $allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'),'allinone');
536  $allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isAllInOneCategoryEnabled());
537  $allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info'));
538 
539  $allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'),'allinone_cat');
540  $allinone_cat->setRequired(true);
541 
542  $tpl = new ilTemplate('tpl.ecs_import_id_form.html',true,true,'Services/WebServices/ECS');
543  $tpl->setVariable('SIZE',5);
544  $tpl->setVariable('MAXLENGTH',11);
545  $tpl->setVariable('POST_VAR','allinone_cat');
546 
547  $cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->getAllInOneCategory();
548  $tpl->setVariable('PROPERTY_VALUE',$cat);
549  if($cat)
550  {
551  include_once './Services/Tree/classes/class.ilPathGUI.php';
552  $path = new ilPathGUI();
553  $path->enableTextOnly(false);
554  $path->enableHideLeaf(false);
555  $tpl->setVariable('COMPLETE_PATH',$path->getPath(ROOT_FOLDER_ID, $default));
556  }
557 
558  $allinone_cat->setHtml($tpl->get());
559  $allinone->addSubItem($allinone_cat);
560  $form->addItem($allinone);
561 
562  // multiple attributes
563  $multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'),'multiple');
564  $multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isAttributeMappingEnabled());
565 
566  // attribute selection
567  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
568  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
569  $attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'),'atts');
570  $attributes->setMulti(true);
571  $attributes->setValue(
573  $this->getServer()->getServerId(),
574  $this->getMid()
575  )->getAttributeValues());
576  $attributes->setRequired(true);
578  $multiple->addSubItem($attributes);
579 
580  $form->addItem($multiple);
581 
582  // role mapping
583  $rm = new ilFormSectionHeaderGUI();
584  $rm->setTitle($this->lng->txt('ecs_role_mappings'));
585  $form->addItem($rm);
586 
587  // auth type
588  $auth_type = new ilSelectInputGUI($this->lng->txt('ecs_member_auth_type'), 'auth_mode');
590  $auth_type->setRequired(true);
591  $auth_type->setValue(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->getAuthMode());
592  $form->addItem($auth_type);
593 
594  $mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->getRoleMappings();
595 
596  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
597  foreach(ilECSMappingUtils::getRoleMappingInfo() as $name => $info)
598  {
599  $role_map = new ilTextInputGUI($this->lng->txt($info['lang']),$name);
600  $role_map->setValue($mapping_defs[$name]);
601  $role_map->setSize(32);
602  $role_map->setMaxLength(64);
603  $role_map->setRequired($info['required']);
604  $form->addItem($role_map);
605  }
606 
607  $form->addCommandButton('cUpdateSettings',$this->lng->txt('save'));
608  $form->addCommandButton('cSettings', $this->lng->txt('cancel'));
609 
610  return $form;
611  }
612 
617  protected function dSettings(ilPropertyFormGUI $form = NULL)
618  {
619  global $ilTabs;
620 
621  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
622  $this->setSubTabs(self::TAB_DIRECTORY);
623  $ilTabs->activateTab('ecs_dir_allocation');
624  $ilTabs->activateSubTab('dSettings');
625 
626  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
627  if(!$form instanceof ilPropertyFormGUI)
628  {
629  $form = $this->initFormDSettings();
630  }
631 
632  $GLOBALS['tpl']->setContent($form->getHTML());
633 
634  return true;
635  }
636 
640  protected function cUpdateSettings()
641  {
642  $form = $this->initFormCSettings();
643  if($form->checkInput())
644  {
645  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
646  $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid());
647  $settings->enableCourseAllocation($form->getInput('enabled'));
648  $settings->setDefaultCourseCategory($form->getInput('default_cat'));
649  $settings->enableAllInOne($form->getInput('allinone'));
650  $settings->setAllInOneCategory($form->getInput('allinone_cat'));
651  $settings->enableAttributeMapping($form->getInput('multiple'));
652  $settings->setAuthMode($form->getInput('auth_mode'));
653 
654 
655  $role_mappings = array();
656  foreach(ilECSMappingUtils::getRoleMappingInfo() as $name => $info)
657  {
658  $role_mappings[$name] = $form->getInput($name);
659  }
660  $settings->setRoleMappings($role_mappings);
661  $settings->update();
662 
663  // store attribute settings
664  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
665  $attributes = new ilECSCourseAttributes($this->getServer()->getServerId(),$this->getMid());
666  $attributes->delete();
667 
668  $form_atts = $form->getInput('atts');
669 
670  foreach($form_atts as $name)
671  {
672  if(!$name)
673  {
674  continue;
675  }
676 
677  $att = new ilECSCourseAttribute();
678  $att->setServerId($this->getServer()->getServerId());
679  $att->setMid($this->getMid());
680  $att->setName($name);
681  $att->save();
682  }
683 
684  //$att = new ilECSCourseAttribute();
685  //$att->setName($a_name)
686 
687  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
688  $GLOBALS['ilCtrl']->redirect($this,'cSettings');
689  }
690  ilUtil::sendFailure($this->lng->txt('err_check_input'));
691  $form->setValuesByPost();
692  $this->cSettings($form);
693  }
694 
699  protected function cAttributes()
700  {
701  global $ilTabs;
702 
703  $this->setSubTabs(self::TAB_COURSE);
704  $ilTabs->setTabActive('ecs_crs_allocation');
705  $ilTabs->setSubTabActive('cAttributes');
706 
707  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributesTableGUI.php';
708  $table = new ilECSCourseAttributesTableGUI(
709  $this,
710  'attributes',
711  $this->getServer()->getServerId(),
712  $this->getMid()
713  );
714  $table->init();
715  $table->parse(
717  $this->getServer()->getServerId(),
718  $this->getMid())->getAttributes());
719 
720  $GLOBALS['tpl']->setContent($table->getHTML());
721  }
722 
723 
724 
728  protected function dUpdateSettings()
729  {
730  global $ilCtrl;
731 
732  $form = $this->initFormDSettings();
733  if($form->checkInput())
734  {
735  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
736  $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid());
737  $settings->enableDirectoryMapping((bool) $form->getInput('active'));
738  $settings->enableEmptyContainerCreation(!$form->getInput('empty'));
739  $settings->update();
740  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
741  }
742  else
743  {
744  ilUtil::sendFailure($this->lng->txt('err_check_input'),true);
745  $form->setValuesByPost();
746  }
747  $ilCtrl->redirect($this,'dSettings');
748  }
749 
753  protected function initFormDSettings()
754  {
755  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
756  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
757 
758  $form = new ilPropertyFormGUI();
759  $form->setFormAction($this->ctrl->getFormAction($this));
760  $form->setTitle($this->lng->txt('general_settings'));
761 
762  $active = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_activate'), 'active');
763  $active->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isDirectoryMappingEnabled());
764  $form->addItem($active);
765 
766  $create_empty = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_create_empty'), 'empty');
767  $create_empty->setChecked(!ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isEmptyContainerCreationEnabled());
768  $create_empty->setInfo($this->lng->txt('ecs_node_mapping_create_empty_info'));
769  $form->addItem($create_empty);
770 
771  $form->addCommandButton('dUpdateSettings',$this->lng->txt('save'));
772  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
773 
774  return $form;
775  }
776 
780  protected function dTrees()
781  {
782  global $ilToolbar;
783 
784  $this->setSubTabs(self::TAB_DIRECTORY);
785  $GLOBALS['ilTabs']->activateSubTab('dTrees');
786  $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
787 
788  $ilToolbar->addButton(
789  $this->lng->txt('ecs_sync_trees'),
790  $this->ctrl->getLinkTarget($this, 'dSynchronizeTrees'));
791 
792  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingTreeTableGUI.php';
793 
794  $dtreeTable = new ilECSNodeMappingTreeTableGUI(
795  $this->getServer()->getServerId(),
796  $this->getMid(),
797  $this,
798  'dtree');
799 
800 
801  $dtreeTable->parse();
802  $GLOBALS['tpl']->setContent($dtreeTable->getHTML());
803  return true;
804  }
805 
809  protected function dConfirmDeleteTree()
810  {
811  $this->setSubTabs(self::TAB_DIRECTORY);
812  $GLOBALS['ilTabs']->activateSubTab('dTrees');
813  $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
814 
815  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
816  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
817 
818  $confirm = new ilConfirmationGUI();
819  $confirm->setFormAction($this->ctrl->getFormAction($this));
820  $confirm->setHeaderText($this->lng->txt('ecs_confirm_delete_tree'));
821 
822  $confirm->addItem(
823  'tid',
824  (int) $_REQUEST['tid'],
826  $this->getServer()->getServerId(),
827  $this->getMid(),
828  (int) $_REQUEST['tid']
829  )
830  );
831  $confirm->setConfirm($this->lng->txt('delete'), 'dDeleteTree');
832  $confirm->setCancel($this->lng->txt('cancel'), 'dTrees');
833 
834  $GLOBALS['tpl']->setContent($confirm->getHTML());
835  }
836 
840  protected function dDeleteTree()
841  {
842  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
843  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
844 
845  $GLOBALS['ilLog']->write('Deleting tree');
846 
847  $tree = new ilECSCmsTree((int) $_REQUEST['tid']);
848  $tree->deleteTree($tree->getNodeData(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
849 
850 
851 
852  // also delete import information
853  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
855  $this->getServer()->getServerId(),
856  $this->getMid(),
858  $this->getServer()->getServerId(),
859  $this->getMid(),
860  (int) $_REQUEST['tid']
861  )
862  );
863 
864  $data = new ilECSCmsData();
865  $data->setServerId($this->getServer()->getServerId());
866  $data->setMid($this->getMid());
867  $data->setTreeId((int) $_REQUEST['tid']);
868  $data->deleteTree();
869 
870 
871  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
873  $this->getServer()->getServerId(),
874  $this->getMid(),
875  (int) $_REQUEST['tid']
876  );
877 
878  ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_deleted'),true);
879  $this->ctrl->redirect($this,'dTrees');
880  }
881 
885  protected function dEditTree(ilPropertyFormGUI $form = null)
886  {
887  $GLOBALS['tpl']->addBlockFile('ADM_CONTENT','adm_content','tpl.ecs_edit_tree.html','Services/WebServices/ECS');
888 
889  $this->ctrl->saveParameter($this,'cid');
890 
891  $GLOBALS['ilTabs']->clearTargets();
892  $GLOBALS['ilTabs']->setBack2Target(
893  $this->lng->txt('ecs_back_settings'),
894  $this->ctrl->getLinkTarget($this,'cancel')
895  );
896  $GLOBALS['ilTabs']->setBackTarget(
897  $this->lng->txt('ecs_cms_dir_tree'),
898  $this->ctrl->getLinkTarget($this,'dTrees')
899  );
900 
901  $GLOBALS['tpl']->setVariable('LEGEND',$GLOBALS['lng']->txt('ecs_status_legend'));
902  $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED',$GLOBALS['lng']->txt('ecs_status_pending_unmapped'));
903  $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED_DISCON',$GLOBALS['lng']->txt('ecs_status_pending_unmapped_discon'));
904  $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED_NONDISCON',$GLOBALS['lng']->txt('ecs_status_pending_unmapped_nondiscon'));
905  $GLOBALS['tpl']->setVariable('MAPPED',$GLOBALS['lng']->txt('ecs_status_mapped'));
906  $GLOBALS['tpl']->setVariable('DELETED',$GLOBALS['lng']->txt('ecs_status_deleted'));
907 
908  $form = $this->dInitFormTreeSettings($form);
909  $GLOBALS['tpl']->setVariable('GENERAL_FORM',$form->getHTML());
910  $GLOBALS['tpl']->setVariable('TFORM_ACTION',$this->ctrl->getFormAction($this,'dEditTree'));
911 
912  $explorer = $this->dShowLocalExplorer();
913  $this->dShowCmsExplorer($explorer);
914  }
915 
919  protected function dInitFormTreeSettings(ilPropertyFormGUI $form = null)
920  {
921  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
922  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
923 
924  if($form instanceof ilPropertyFormGUI)
925  {
926  return $form;
927  }
928 
929  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
930  $assignment = new ilECSNodeMappingAssignment(
931  $this->getServer()->getServerId(),
932  $this->getMid(),
933  (int) $_REQUEST['tid'],
934  0
935  );
936 
937  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
938  $form = new ilPropertyFormGUI();
939  $form->setFormAction($this->ctrl->getFormAction($this,'dEditTree'));
940  $form->setTitle($this->lng->txt('general_settings'));
941  $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
942  $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
943  $form->setTableWidth('30%');
944 
945  // CMS id (readonly)
946  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
947  $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
948  $cmsid->setValue(
950  );
951  $cmsid->setDisabled(true);
952  $cmsid->setSize(7);
953  $cmsid->setMaxLength(12);
954  $form->addItem($cmsid);
955 
956 
957  $mapping_status = ilECSMappingUtils::lookupMappingStatus(
958  $this->getServer()->getServerId(),
959  $this->getMid(),
960  (int) $_REQUEST['tid']);
961  $mapping_advanced = ($mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false);
962 
963  // Status (readonly)
964  $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
965  $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
966  $form->addItem($status);
967 
968  // title update
969  $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
970  $title->setValue(1);
971  $title->setChecked($assignment->isTitleUpdateEnabled());
972  #$title->setInfo($this->lng->txt('ecs_title_update_info'));
973  $form->addItem($title);
974 
975 
976  $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
977  $position->setDisabled(!$mapping_advanced);
978  $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
979  $position->setValue(1);
980  #$position->setInfo($this->lng->txt('ecs_position_update_info'));
981  $form->addItem($position);
982 
983  $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
984  $tree->setDisabled(!$mapping_advanced);
985  $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
986  $tree->setValue(1);
987  #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
988  $form->addItem($tree);
989 
990  return $form;
991  }
992 
997  protected function dUpdateTreeSettings()
998  {
999  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
1000  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1001  $assignment = new ilECSNodeMappingAssignment(
1002  $this->getServer()->getServerId(),
1003  $this->getMid(),
1004  (int) $_REQUEST['tid'],
1005  0
1006  );
1007  $assignment->setRefId(0);
1008  $assignment->setObjId(0);
1009 
1010  $form = $this->dInitFormTreeSettings();
1011  if($form->checkInput())
1012  {
1013  $assignment->enableTitleUpdate($form->getInput('title'));
1014  $assignment->enableTreeUpdate($form->getInput('tree'));
1015  $assignment->enablePositionUpdate($form->getInput('position'));
1016  $assignment->update();
1017 
1018  ilUtil::sendSuccess($this->lng->txt('settings_saved',true));
1019  $this->ctrl->redirect($this,'dEditTree');
1020  }
1021 
1022  $form->setValuesByPost();
1023  ilUtil::sendFailure($this->lng->txt('err_check_input'));
1024  $this->dEditTree($form);
1025  return true;
1026  }
1027 
1031  protected function dSynchronizeTree()
1032  {
1033  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTreeSynchronizer.php';
1034  $sync = new ilECSCmsTreeSynchronizer(
1035  $this->getServer(),
1036  $this->mid,
1037  (int) $_REQUEST['tid']
1038  );
1039  $sync->sync();
1040  ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_synchronized'),true);
1041  $this->ctrl->redirect($this,'dTrees');
1042  }
1043 
1044  protected function dSynchronizeTrees()
1045  {
1046  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
1047 
1048  $this->log->dump('Start synchronizing cms directory trees');
1049 
1050  try
1051  {
1052  $connector = new ilECSDirectoryTreeConnector($this->getServer());
1053  $res = $connector->getDirectoryTrees();
1054 
1055  $this->log->dump($res, ilLogLevel::DEBUG);
1056 
1057  foreach((array) $res->getLinkIds() as $cms_id)
1058  {
1059  include_once './Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
1060  include_once './Services/WebServices/ECS/classes/class.ilECSEvent.php';
1061  $event = new ilECSEventQueueReader($this->getServer()->getServerId());
1062  $event->add(
1064  $cms_id,
1066  );
1067  }
1068  $this->ctrl->redirect($this,'dTrees');
1069  }
1070  catch(Exception $e)
1071  {
1072  ilUtil::sendFailure($e->getMessage(),true);
1073  $this->ctrl->redirect($this,'dTrees');
1074  }
1075  }
1076 
1080  protected function dShowLocalExplorer()
1081  {
1082  global $tree;
1083 
1084  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
1085  $explorer = new ilECSNodeMappingLocalExplorer(
1086  $this->ctrl->getLinkTarget($this,'dEditTree'),
1087  $this->getServer()->getServerId(),
1088  $this->getMid()
1089  );
1090  $explorer->setPostVar('lnodes[]');
1091 
1092  $lnodes = (array) $_REQUEST['lnodes'];
1093  $checked_node = array_pop($lnodes);
1094  if((int) $_REQUEST['lid'])
1095  {
1096  $checked_node = (int) $_REQUEST['lid'];
1097  }
1098 
1099  if($checked_node)
1100  {
1101  $explorer->setCheckedItems(array($checked_node));
1102  }
1103  else
1104  {
1105  $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
1106  }
1107  $explorer->setTargetGet('lref_id');
1108  $explorer->setSessionExpandVariable('lexpand');
1109  $explorer->setExpand((int) $_GET['lexpand']);
1110  $explorer->setExpandTarget($this->ctrl->getLinkTarget($this,'dEditTree'));
1111  $explorer->setOutput(0);
1112  $GLOBALS['tpl']->setVariable('LOCAL_EXPLORER',$explorer->getOutput());
1113 
1114  return $explorer;
1115  }
1116 
1120  protected function dShowCmsExplorer(ilExplorer $localExplorer)
1121  {
1122  global $tree;
1123 
1124  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1125  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingCmsExplorer.php';
1126  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1127 
1128  $explorer = new ilECSNodeMappingCmsExplorer(
1129  $this->ctrl->getLinkTarget($this,'dEditTree'),
1130  $this->getServer()->getServerId(),
1131  $this->getMid(),
1132  (int) $_REQUEST['tid']
1133  );
1134  $explorer->setRoot(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid']));
1135  $explorer->setTree(
1136  new ilECSCmsTree(
1137  (int) $_REQUEST['tid']
1138  )
1139  );
1140  $explorer->setPostVar('rnodes[]');
1141 
1142  // Read checked items from mapping of checked items in local explorer
1143  $active_node = $tree->getRootId();
1144  foreach($localExplorer->getCheckedItems() as $ref_id)
1145  {
1146  $explorer->setCheckedItems(
1148  $this->getServer()->getServerId(),
1149  $this->getMid(),
1150  (int) $_REQUEST['tid'],
1151  $ref_id
1152  )
1153  );
1154  $active_node = $ref_id;
1155  }
1156 
1157 
1158  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1159  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1160  $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1162  $this->getServer()->getServerId(),
1163  $this->getMid(),
1164  (int) $_REQUEST['tid'],
1165  $active_node
1166  ) as $cs_id)
1167  {
1168  foreach($cmsTree->getPathId($cs_id) as $path_id)
1169  {
1170  #$explorer->setExpand($path_id);
1171  }
1172  }
1173 
1174  $explorer->setTargetGet('rref_id');
1175  $explorer->setSessionExpandVariable('rexpand');
1176 
1177  #if((int) $_REQUEST['rexpand'])
1178  {
1179  $explorer->setExpand((int) $_GET['rexpand']);
1180  }
1181  $explorer->setExpandTarget($this->ctrl->getLinkTarget($this,'dEditTree'));
1182  $explorer->setOutput(0);
1183  $GLOBALS['tpl']->setVariable('REMOTE_EXPLORER',$explorer->getOutput());
1184 
1185  }
1186 
1191  protected function dInitEditTree()
1192  {
1193  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
1195  $this->getServer()->getServerId(),
1196  $this->getMid(),
1197  (int) $_REQUEST['tid']
1198  );
1199  return $this->dEditTree();
1200  }
1201 
1202 
1206  protected function dMap()
1207  {
1208  if(!$_POST['lnodes'])
1209  {
1210  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1211  $this->ctrl->redirect($this,'dEditTree');
1212  }
1213 
1214  $ref_id = end($_POST['lnodes']);
1215 
1216  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1218  $this->getServer()->getServerId(),
1219  $this->getMid(),
1220  (int) $_REQUEST['tid'],
1221  $ref_id
1222  );
1223 
1224 
1225  $nodes = (array) $_POST['rnodes'];
1226  $nodes = (array) array_reverse($nodes);
1227 
1228  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
1229  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1230  include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1231  foreach($nodes as $cms_id)
1232  {
1233  $assignment = new ilECSNodeMappingAssignment(
1234  $this->getServer()->getServerId(),
1235  $this->getMid(),
1236  (int) $_REQUEST['tid'],
1237  (int) $cms_id
1238  );
1239  $assignment->setRefId($ref_id);
1240  $assignment->setObjId(ilObject::_lookupObjId($ref_id));
1241  $assignment->enablePositionUpdate(false);
1242  $assignment->enableTreeUpdate(false);
1243  $assignment->enableTitleUpdate(ilECSNodeMappingAssignments::lookupDefaultTitleUpdate(
1244  $this->getServer()->getServerId(),
1245  $this->getMid(),
1246  (int) $_REQUEST['tid']
1247  ));
1248  $assignment->update();
1249 
1250  // Delete subitems mappings for cms subtree
1251  $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1252  $childs = $cmsTree->getSubTreeIds($cms_id);
1253 
1255  $this->getServer()->getServerId(),
1256  $this->getMid(),
1257  (int) $_REQUEST['tid'],
1258  $childs
1259  );
1260 
1261  }
1262 
1264  $this->getServer()->getServerId(),
1265  $this->getMid(),
1266  (int) $_REQUEST['tid']
1267  );
1268 
1269  // Save parameter cid
1270  $this->ctrl->setParameter($this,'lid',(int) $ref_id);
1271 
1272  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1273  $this->ctrl->redirect($this,'dEditTree');
1274  }
1275 
1279  protected function dMappingOverview()
1280  {
1281  $this->setSubTabs(self::TAB_DIRECTORY);
1282  $GLOBALS['ilTabs']->activateSubTab('dMappingOverview');
1283  $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
1284  }
1285 
1286 
1287 
1292  protected function setTabs()
1293  {
1294  global $ilTabs;
1295 
1296  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
1297 
1298  $ilTabs->clearTargets();
1299  $ilTabs->setBackTarget(
1300  $this->lng->txt('ecs_back_settings'),
1301  $this->ctrl->getParentReturn($this)
1302  );
1303  // Directories are only visible for import type campus managment.
1304  if(ilECSParticipantSettings::loookupCmsMid($this->getServer()->getServerId()) == $this->getMid())
1305  {
1306  $ilTabs->addTab(
1307  'ecs_dir_allocation',
1308  $this->lng->txt('ecs_dir_alloc'),
1309  $this->ctrl->getLinkTarget($this,'dSettings')
1310  );
1311  }
1312 
1313  $ilTabs->addTab(
1314  'ecs_crs_allocation',
1315  $this->lng->txt('ecs_crs_alloc'),
1316  $this->ctrl->getLinkTarget($this,'cStart')
1317  );
1318  }
1319 
1325  protected function setSubTabs($a_tab)
1326  {
1327  global $ilTabs;
1328 
1329  if($a_tab == self::TAB_DIRECTORY)
1330  {
1331  $ilTabs->addSubTab(
1332  'dMappingOverview',
1333  $this->lng->txt('ecs_cc_mapping_overview'),
1334  $this->ctrl->getLinkTarget($this,'dMappingOverview')
1335  );
1336  $ilTabs->addSubTab(
1337  'dTrees',
1338  $this->lng->txt('ecs_cms_dir_tree'),
1339  $this->ctrl->getLinkTarget($this,'dTrees')
1340  );
1341  $ilTabs->addSubTab(
1342  'dSettings',
1343  $this->lng->txt('settings'),
1344  $this->ctrl->getLinkTarget($this,'dSettings')
1345  );
1346  }
1347  if($a_tab == self::TAB_COURSE)
1348  {
1349  // Check if attributes are available
1350  include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
1351  $atts = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
1352 
1353  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
1354  if(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isCourseAllocationEnabled())
1355  {
1356  $ilTabs->addSubTab(
1357  'cInitTree',
1358  $this->lng->txt('ecs_cmap_overview'),
1359  $this->ctrl->getLinkTarget($this,'cInitOverview')
1360  );
1361  }
1362 
1363  $ilTabs->addSubTab(
1364  'cSettings',
1365  $this->lng->txt('settings'),
1366  $this->ctrl->getLinkTarget($this,'cSettings')
1367  );
1368 
1369  }
1370  }
1371 }
1372 ?>
static lookupCmsIdsOfTree($a_server_id, $a_mid, $a_tree_id)
$ilDB $ilDB
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getRulesOfRefId($a_sid, $a_mid, $a_ref_id)
Get all rule of ref_id type $ilDB.
Creates a path for a start and endnode.
This class represents an option in a radio group.
dMappingOverview()
Show directory trees.
$path
Definition: aliased.php:25
static getRoleMappingInfo($a_role_type_info=0)
Get role mapping info.
static updateStatus($a_server_id, $a_mid, $a_tree_id)
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
static hasRules($a_sid, $a_mid, $a_ref_id)
setValue($a_value)
Set Value.
This class represents a selection list property in a property form.
This class represents a property form user interface.
getContainer()
Get container object.
$_GET["client_id"]
cSettings(ilPropertyFormGUI $form=NULL)
Show course allocation ilTabsGUI $ilTabs.
This class represents a section header in a property form.
setTabs()
Set tabs ilTabsGUI $ilTabs.
static lookupRootId($a_tree_id)
lookup root id
executeCommand()
ilCtrl executeCommand
static lookupTitle($a_server_id, $a_mid, $a_tree_id)
Lookup title by obj id.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$cmd
Definition: sahs_server.php:35
dShowCmsExplorer(ilExplorer $localExplorer)
Show cms explorer.
static deleteMappings($a_server_id, $a_mid, $a_tree_id)
Delete mappings $ilDB $ilDB.
static getInstanceByServerMid($a_server_id, $a_mid)
Get instance.
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
Add rich text string
The name of the decorator.
cAttributes()
Show active attributes ilTabsGUI $ilTabs.
setInfo($a_info)
Set Info.
static lookupMappingStatus($a_server_id, $a_mid, $a_tree_id)
Lookup mapping status.
dEditTree(ilPropertyFormGUI $form=null)
Edit directory tree assignments.
static getCourseMappingFieldSelectOptions()
global $tpl
Definition: ilias.php:8
static lookupDefaultTitleUpdate($a_server_id, $a_mid, $a_tree_id)
Lookup default title update setting.
cancel()
return to parent container
global $ilCtrl
Definition: ilias.php:18
$section
Definition: Utf8Test.php:83
setChecked($a_checked)
Set Checked.
cShowLocalExplorer()
Show local explorer.
This class represents a hidden form property in a property form.
$info
Definition: example_052.php:80
static mappingStatusToString($a_status)
Get mapping status as string.
__construct($settingsContainer, $server_id, $mid)
Constructor.
This class represents a property in a property form.
setValue($a_value)
Set Value.
static deleteDisconnectableMappings($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
delete disconnectable mappings
cAddAttribute()
Add one attribute in form.
Storage of course attributes for assignment rules.
cInitOverview($form=null, $current_attribute=null)
Show overview page.
This class represents a number property in a property form.
static getAuthModeSelection()
Get auth mode selection.
dSettings(ilPropertyFormGUI $form=NULL)
Show directory allocation ilTabsGUI $ilTabs.
static _lookupObjId($a_id)
static getInstance($a_server_id, $a_mid)
Get instance.
static deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $cs_ids)
Delete mappings $ilDB.
special template class to simplify handling of ITX/PEAR
static lookupLastExistingAttribute($a_sid, $a_mid, $a_ref_id)
Lookup existing attributes.
This class represents a text property in a property form.
Reads ECS events and stores them in the database.
static lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Lookup assignments.
cUpdateSettings()
Update course settings.
setOptions($a_options)
Set Options.
dUpdateSettings()
Update node mapping settings.
dInitFormTreeSettings(ilPropertyFormGUI $form=null)
Init form settings.
Create styles array
The data for the language used.
static getInstanceByAttribute($a_sid, $a_mid, $a_ref_id, $a_att)
Get rule instance by attribute type $ilDB.
Class ilExplorer class for explorer view in admin frame.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
cInitMappingForm($current_node, $current_attribute)
Init the mapping form.
dConfirmDeleteTree()
Delete tree settings.
cDeleteAttribute()
Delete last attribute in form.
static lookupCmsId($a_obj_id)
Lookup cms id.
This class represents a custom property in a property form.
static deleteRessources($a_server_id, $a_mid, $a_econtent_ids)
Delete ressources $ilDB.
This class represents a non editable value in a property form.
setMulti($a_multi, $a_sortable=false, $a_addremove=true)
Set Multi.
static loookupCmsMid($a_server_id)
Lookup mid of current cms participant $ilDB.
$ref_id
Definition: sahs_server.php:39
Storage of course attributes for assignment rules.
static lookupMappedItemsForRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Get cs ids for ref_id <type> $ilDB.
setValue($a_value)
Set Value.
setDisabled($a_disabled)
Set Disabled.
$_POST["username"]
setRequired($a_required)
Set Required.
Confirmation screen class.
setSubTabs($a_tab)
Set Sub tabs ilTabsGUI $ilTabs.