ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilECSMappingSettingsGUI Class Reference
+ Collaboration diagram for ilECSMappingSettingsGUI:

Public Member Functions

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

Data Fields

const TAB_DIRECTORY = 1
 
const TAB_COURSE = 2
 

Protected Member Functions

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

Protected Attributes

 $log
 
 $lng = null
 
 $ctrl = null
 

Private Attributes

 $container = null
 
 $server = null
 
 $mid = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
ilObjectGUI$settingsContainer

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

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 }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18

References $GLOBALS, $ilCtrl, $lng, $mid, and ilECSSetting\getInstanceByServerId().

+ Here is the call graph for this function:

Member Function Documentation

◆ cAddAttribute()

ilECSMappingSettingsGUI::cAddAttribute ( )
protected

Add one attribute in form.

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

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 }
static getInstance($a_server_id, $a_mid)
Get instance.
cInitOverview($form=null, $current_attribute=null)
Show overview page.

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

+ Here is the call graph for this function:

◆ cancel()

ilECSMappingSettingsGUI::cancel ( )

return to parent container

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

115 {
116 $GLOBALS['ilCtrl']->returnToParent($this);
117 }

References $GLOBALS.

◆ cAttributes()

ilECSMappingSettingsGUI::cAttributes ( )
protected

Show active attributes @global ilTabsGUI $ilTabs.

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

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 }
setSubTabs($a_tab)
Set Sub tabs @global ilTabsGUI $ilTabs.

References $GLOBALS, ilECSCourseAttributes\getInstance(), getMid(), getServer(), and setSubTabs().

+ Here is the call graph for this function:

◆ cDeleteAttribute()

ilECSMappingSettingsGUI::cDeleteAttribute ( )
protected

Delete last attribute in form.

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

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 }

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

+ Here is the call graph for this function:

◆ cDeleteRulesOfNode()

ilECSMappingSettingsGUI::cDeleteRulesOfNode ( )
protected

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

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 }
static getRulesOfRefId($a_sid, $a_mid, $a_ref_id)
Get all rule of ref_id @global type $ilDB.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References getMid(), ilECSCourseMappingRule\getRulesOfRefId(), getServer(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ cInitMappingForm()

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

Init the mapping form.

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

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 }
$section
Definition: Utf8Test.php:83
This class represents a checkbox property in a property form.
static hasRules($a_sid, $a_mid, $a_ref_id)
static getInstanceByAttribute($a_sid, $a_mid, $a_ref_id, $a_att)
Get rule instance by attribute @global type $ilDB.
This class represents a section header in a property form.
This class represents a hidden form property in a property form.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
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 text property in a property form.

References $section, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilECSCourseAttributes\getInstance(), ilECSCourseMappingRule\getInstanceByAttribute(), getMid(), getServer(), and ilECSCourseMappingRule\hasRules().

Referenced by cInitOverview(), and cSaveOverview().

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

◆ cInitOverview()

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

Show overview page.

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

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 }
static lookupLastExistingAttribute($a_sid, $a_mid, $a_ref_id)
Lookup existing attributes.
cInitMappingForm($current_node, $current_attribute)
Init the mapping form.

References $GLOBALS, cInitMappingForm(), cShowLocalExplorer(), getMid(), getServer(), ilECSCourseMappingRule\lookupLastExistingAttribute(), and setSubTabs().

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

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

◆ cSaveOverview()

ilECSMappingSettingsGUI::cSaveOverview ( )
protected

Save overview.

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

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 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References cInitMappingForm(), cInitOverview(), ilECSCourseMappingRule\getInstanceByAttribute(), getMid(), getServer(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ cSettings()

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

Show course allocation @global ilTabsGUI $ilTabs.

Returns
bool

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

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 }

References $GLOBALS, initFormCSettings(), and setSubTabs().

Referenced by cStart(), and cUpdateSettings().

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

◆ cShowLocalExplorer()

ilECSMappingSettingsGUI::cShowLocalExplorer ( )
protected

Show local explorer.

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

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 }
$_GET["client_id"]

References $_GET.

Referenced by cInitOverview().

+ Here is the caller graph for this function:

◆ cStart()

ilECSMappingSettingsGUI::cStart ( )
protected

Goto default page.

Returns
<type>

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

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 }
cSettings(ilPropertyFormGUI $form=NULL)
Show course allocation @global ilTabsGUI $ilTabs.
static getInstanceByServerMid($a_server_id, $a_mid)
Get instance.

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

+ Here is the call graph for this function:

◆ cUpdateSettings()

ilECSMappingSettingsGUI::cUpdateSettings ( )
protected

Update course settings.

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

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 }
Storage of course attributes for assignment rules.
Storage of course attributes for assignment rules.
static getRoleMappingInfo($a_role_type_info=0)
Get role mapping info.
$info
Definition: example_052.php:80

References $GLOBALS, $info, cSettings(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), ilECSMappingUtils\getRoleMappingInfo(), getServer(), initFormCSettings(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ dConfirmDeleteTree()

ilECSMappingSettingsGUI::dConfirmDeleteTree ( )
protected

Delete tree settings.

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

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 }
Confirmation screen class.
static lookupTitle($a_server_id, $a_mid, $a_tree_id)
Lookup title by obj id.

References $GLOBALS, getMid(), getServer(), ilECSCmsData\lookupTitle(), and setSubTabs().

+ Here is the call graph for this function:

◆ dDeleteTree()

ilECSMappingSettingsGUI::dDeleteTree ( )
protected

Delete tree.

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

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 }
static lookupCmsIdsOfTree($a_server_id, $a_mid, $a_tree_id)
@global $ilDB $ilDB
static lookupRootId($a_tree_id)
lookup root id
static deleteRessources($a_server_id, $a_mid, $a_econtent_ids)
Delete ressources @global $ilDB.
static deleteMappings($a_server_id, $a_mid, $a_tree_id)
Delete mappings @global $ilDB $ilDB.

References $data, $GLOBALS, ilECSNodeMappingAssignments\deleteMappings(), ilECSImport\deleteRessources(), getMid(), getServer(), ilECSCmsData\lookupCmsIdsOfTree(), ilECSCmsTree\lookupRootId(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ dEditTree()

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

Edit directory tree assignments.

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

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 }
dShowCmsExplorer(ilExplorer $localExplorer)
Show cms explorer.
dInitFormTreeSettings(ilPropertyFormGUI $form=null)
Init form settings.

References $GLOBALS, dInitFormTreeSettings(), dShowCmsExplorer(), and dShowLocalExplorer().

Referenced by dInitEditTree(), and dUpdateTreeSettings().

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

◆ dInitEditTree()

ilECSMappingSettingsGUI::dInitEditTree ( )
protected

Init tree.

Returns

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

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 }
static updateStatus($a_server_id, $a_mid, $a_tree_id)
dEditTree(ilPropertyFormGUI $form=null)
Edit directory tree assignments.

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

+ Here is the call graph for this function:

◆ dInitFormTreeSettings()

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

Init form settings.

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

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
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 }
static lookupCmsId($a_obj_id)
Lookup cms id.
static mappingStatusToString($a_status)
Get mapping status as string.
static lookupMappingStatus($a_server_id, $a_mid, $a_tree_id)
Lookup mapping status.
setFormAction($a_formaction)
Set FormAction.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
setTableWidth($a_width)
Set table width.
setTitle($a_title)
Set Title.

References $title, getMid(), getServer(), ilECSCmsData\lookupCmsId(), ilECSMappingUtils\lookupMappingStatus(), ilECSCmsTree\lookupRootId(), ilECSMappingUtils\MAPPED_MANUAL, and ilECSMappingUtils\mappingStatusToString().

Referenced by dEditTree(), and dUpdateTreeSettings().

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

◆ dMap()

ilECSMappingSettingsGUI::dMap ( )
protected

Do mapping.

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

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 }
$_POST["username"]
static lookupDefaultTitleUpdate($a_server_id, $a_mid, $a_tree_id)
Lookup default title update setting.
static deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $cs_ids)
Delete mappings @global $ilDB.
static deleteDisconnectableMappings($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
delete disconnectable mappings
$ref_id
Definition: sahs_server.php:39

References $_POST, $ref_id, ilObject\_lookupObjId(), ilECSNodeMappingAssignments\deleteDisconnectableMappings(), ilECSNodeMappingAssignments\deleteMappingsByCsId(), getMid(), getServer(), ilECSNodeMappingAssignments\lookupDefaultTitleUpdate(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilECSCmsData\updateStatus().

+ Here is the call graph for this function:

◆ dMappingOverview()

ilECSMappingSettingsGUI::dMappingOverview ( )
protected

Show directory trees.

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

1280 {
1281 $this->setSubTabs(self::TAB_DIRECTORY);
1282 $GLOBALS['ilTabs']->activateSubTab('dMappingOverview');
1283 $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
1284 }

References $GLOBALS, and setSubTabs().

+ Here is the call graph for this function:

◆ dSettings()

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

Show directory allocation @global ilTabsGUI $ilTabs.

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

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 }

References $GLOBALS, initFormDSettings(), and setSubTabs().

Referenced by dStart().

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

◆ dShowCmsExplorer()

ilECSMappingSettingsGUI::dShowCmsExplorer ( ilExplorer  $localExplorer)
protected

Show cms explorer.

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

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 }
static lookupMappedItemsForRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Get cs ids for ref_id @global <type> $ilDB.
static lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Lookup assignments.

References $_GET, $GLOBALS, $ref_id, getMid(), getServer(), ilECSNodeMappingAssignments\lookupAssignmentsByRefId(), ilECSNodeMappingAssignments\lookupMappedItemsForRefId(), and ilECSCmsTree\lookupRootId().

Referenced by dEditTree().

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

◆ dShowLocalExplorer()

ilECSMappingSettingsGUI::dShowLocalExplorer ( )
protected

Show local explorer.

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

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 }

References $_GET, and $GLOBALS.

Referenced by dEditTree().

+ Here is the caller graph for this function:

◆ dStart()

ilECSMappingSettingsGUI::dStart ( )
protected

Goto default page.

Returns
<type>

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

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 }
dSettings(ilPropertyFormGUI $form=NULL)
Show directory allocation @global ilTabsGUI $ilTabs.

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

+ Here is the call graph for this function:

◆ dSynchronizeTree()

ilECSMappingSettingsGUI::dSynchronizeTree ( )
protected

Synchronize Tree.

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

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 }

References getServer(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ dSynchronizeTrees()

ilECSMappingSettingsGUI::dSynchronizeTrees ( )
protected

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

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 }
Reads ECS events and stores them in the database.

References $res, ilLogLevel\DEBUG, getServer(), ilUtil\sendFailure(), ilECSEventQueueReader\TYPE_DIRECTORY_TREES, and ilECSEvent\UPDATED.

+ Here is the call graph for this function:

◆ dTrees()

ilECSMappingSettingsGUI::dTrees ( )
protected

Show directory trees.

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

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 }

References $GLOBALS, getMid(), getServer(), and setSubTabs().

Referenced by dStart().

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

◆ dUpdateSettings()

ilECSMappingSettingsGUI::dUpdateSettings ( )
protected

Update node mapping settings.

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

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 }

References $ilCtrl, ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), getServer(), initFormDSettings(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ dUpdateTreeSettings()

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

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

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 }

References dEditTree(), dInitFormTreeSettings(), getMid(), getServer(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ executeCommand()

ilECSMappingSettingsGUI::executeCommand ( )

ilCtrl executeCommand

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

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 }
setTabs()
Set tabs @global ilTabsGUI $ilTabs.
$cmd
Definition: sahs_server.php:35

References $cmd, $GLOBALS, $ilCtrl, getServer(), and setTabs().

+ Here is the call graph for this function:

◆ getContainer()

ilECSMappingSettingsGUI::getContainer ( )

Get container object.

Returns
ilObjectGUI

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

References $container.

◆ getMid()

◆ getServer()

◆ initFormCSettings()

ilECSMappingSettingsGUI::initFormCSettings ( )
protected

Init settings form.

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

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');
589 $auth_type->setOptions(ilECSMappingUtils::getAuthModeSelection());
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 }
global $tpl
Definition: ilias.php:8
$path
Definition: aliased.php:25
This class represents a custom property in a property form.
static getAuthModeSelection()
Get auth mode selection.
static getCourseMappingFieldSelectOptions()
Creates a path for a start and endnode.
This class represents a selection list property in a property form.
special template class to simplify handling of ITX/PEAR

References $info, $path, $tpl, ilECSMappingUtils\getAuthModeSelection(), ilECSMappingUtils\getCourseMappingFieldSelectOptions(), ilECSCourseAttributes\getInstance(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), ilECSMappingUtils\getRoleMappingInfo(), and getServer().

Referenced by cSettings(), and cUpdateSettings().

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

◆ initFormDSettings()

ilECSMappingSettingsGUI::initFormDSettings ( )
protected

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

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 }

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

Referenced by dSettings(), and dUpdateSettings().

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

◆ setSubTabs()

ilECSMappingSettingsGUI::setSubTabs (   $a_tab)
protected

Set Sub tabs @global ilTabsGUI $ilTabs.

Parameters
string$a_tab

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

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 }

References ilECSCourseAttributes\getInstance(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), and getServer().

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

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

◆ setTabs()

ilECSMappingSettingsGUI::setTabs ( )
protected

Set tabs @global ilTabsGUI $ilTabs.

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

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 }
static loookupCmsMid($a_server_id)
Lookup mid of current cms participant @global $ilDB.

References getMid(), getServer(), and ilECSParticipantSettings\loookupCmsMid().

Referenced by executeCommand().

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

Field Documentation

◆ $container

ilECSMappingSettingsGUI::$container = null
private

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

Referenced by getContainer().

◆ $ctrl

ilECSMappingSettingsGUI::$ctrl = null
protected

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

◆ $lng

ilECSMappingSettingsGUI::$lng = null
protected

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

Referenced by __construct().

◆ $log

ilECSMappingSettingsGUI::$log
protected

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

◆ $mid

ilECSMappingSettingsGUI::$mid = null
private

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

Referenced by __construct(), and getMid().

◆ $server

ilECSMappingSettingsGUI::$server = null
private

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

Referenced by getServer().

◆ TAB_COURSE

const ilECSMappingSettingsGUI::TAB_COURSE = 2

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

◆ TAB_DIRECTORY

const ilECSMappingSettingsGUI::TAB_DIRECTORY = 1

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


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