ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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

 $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 31 of file class.ilECSMappingSettingsGUI.php.

32 {
33 global $lng,$ilCtrl;
34
35 $this->container = $settingsContainer;
36 $this->server = ilECSSetting::getInstanceByServerId($server_id);
37 $this->mid = $mid;
38 $this->lng = $lng;
39 $this->lng->loadLanguageModule('ecs');
40 $this->ctrl = $ilCtrl;
41 }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
global $ilCtrl
Definition: ilias.php:18

References $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 204 of file class.ilECSMappingSettingsGUI.php.

205 {
206 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
207 $next_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getNextAttributeName((string) $_REQUEST['ecs_ca']);
208 $this->cInitOverview(NULL, $next_attribute);
209 }
static getInstance($a_server_id, $a_mid)
Get instance.
cInitOverview($form=null, $current_attribute=null)
Show overview page.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

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

+ Here is the call graph for this function:

◆ cancel()

ilECSMappingSettingsGUI::cancel ( )

return to parent container

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

108 {
109 $GLOBALS['ilCtrl']->returnToParent($this);
110 }
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS.

◆ cAttributes()

ilECSMappingSettingsGUI::cAttributes ( )
protected

Show active attributes @global ilTabsGUI $ilTabs.

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

685 {
686 global $ilTabs;
687
688 $this->setSubTabs(self::TAB_COURSE);
689 $ilTabs->setTabActive('ecs_crs_allocation');
690 $ilTabs->setSubTabActive('cAttributes');
691
692 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributesTableGUI.php';
693 $table = new ilECSCourseAttributesTableGUI(
694 $this,
695 'attributes',
696 $this->getServer()->getServerId(),
697 $this->getMid()
698 );
699 $table->init();
700 $table->parse(
702 $this->getServer()->getServerId(),
703 $this->getMid())->getAttributes());
704
705 $GLOBALS['tpl']->setContent($table->getHTML());
706 }
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 214 of file class.ilECSMappingSettingsGUI.php.

215 {
216 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
217 $prev_attribute = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid())->getPreviousAttributeName((string) $_REQUEST['ecs_ca']);
218 $this->cInitOverview(NULL, $prev_attribute);
219 }

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

+ Here is the call graph for this function:

◆ cDeleteRulesOfNode()

ilECSMappingSettingsGUI::cDeleteRulesOfNode ( )
protected

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

440 {
441 $current_node = (int) $_REQUEST['lnodes'];
442
443 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
445 $this->getServer()->getServerId(),
446 $this->getMid(),
447 $current_node);
448
449 foreach($rules as $rid)
450 {
451 $rule = new ilECSCourseMappingRule($rid);
452 $rule->delete();
453 }
454 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
455 $this->ctrl->redirect($this,'cInitOverview');
456 }
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 $_REQUEST, 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 262 of file class.ilECSMappingSettingsGUI.php.

263 {
264 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
265 $attributes_obj = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
266
267 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
268 $form = new ilPropertyFormGUI();
269 $form->setTableWidth("100%");
270 $this->ctrl->setParameter($this,'ecs_ca',$current_attribute);
271 $form->setFormAction($this->ctrl->getFormAction($this));
272 $this->ctrl->setParameter($this,'ecs_ca','');
273
274 $form->setTitle($this->lng->txt('ecs_cmap_mapping_form_title') .' '.ilObject::_lookupTitle(ilObject::_lookupObjId($current_node)));
275
276 // Iterate through all current attributes
277 $attributes = $attributes_obj->getAttributeSequence($current_attribute);
278 foreach($attributes as $att_name)
279 {
280 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
281 $rule = ilECSCourseMappingRule::getInstanceByAttribute($this->getServer()->getServerId(), $this->getMid(), $current_node, $att_name);
282
284 $section->setTitle($this->lng->txt('ecs_cmap_att_'.$att_name));
285
286 // Filter
287 $form->addItem($section);
288
289 $isfilter = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_filter'),$att_name.'_is_filter');
290 $isfilter->setValue($rule->isFilterEnabled() ? 1 : 0);
291
292 $all_values = new ilRadioOption($this->lng->txt('ecs_cmap_form_all_values'),0);
293 $isfilter->addOption($all_values);
294
295 $use_filter = new ilRadioOption($this->lng->txt('ecs_cmap_form_filter_by_values'),1);
296 $filter = new ilTextInputGUI('',$att_name.'_filter');
297 $filter->setInfo($this->lng->txt('ecs_cmap_form_filter_info'));
298 $filter->setSize(50);
299 $filter->setMaxLength(512);
300 $filter->setRequired(true);
301 $filter->setValue($rule->getFilter());
302 $use_filter->addSubItem($filter);
303
304 $isfilter->addOption($use_filter);
305
306 $form->addItem($isfilter);
307
308 // Create subdirs
309 $subdirs = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_form_create_subdirs'),$att_name.'_subdirs');
310 $subdirs->setChecked($rule->isSubdirCreationEnabled());
311 $subdirs->setValue(1);
312
313 // Subdir types (disabled in spec)
314 /*
315 $subdir_type = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_subdir_type'), $att_name.'_subdir_type');
316 $subdir_type->setValue($rule->getSubDirectoryType());
317
318 $value = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_value'), ilECSCourseMappingRule::SUBDIR_VALUE);
319 $subdir_type->addOption($value);
320
321 $name = new ilRadioOption($this->lng->txt('ecs_cmap_form_subdir_name'), ilECSCourseMappingRule::SUBDIR_ATTRIBUTE_NAME);
322 $subdir_type->addOption($name);
323
324 $subdirs->addSubItem($subdir_type);
325 */
326 $form->addItem($subdirs);
327
328 // Directory relations
329 /*
330 $upper_attributes = ilECSCourseAttributes::getInstance(
331 $this->getServer()->getServerId(),
332 $this->getMid())->getUpperAttributes($att_name);
333
334 if($upper_attributes)
335 {
336 $dir_relation = new ilRadioGroupInputGUI($this->lng->txt('ecs_cmap_form_dir_relation'),$att_name.'_dir_relation');
337
338 $current_dir = new ilRadioOption($this->lng->txt('ecs_cmap_form_current_dir'),'');
339 $dir_relation->addOption($current_dir);
340 }
341 foreach($upper_attributes as $subdir_name)
342 {
343 $subdir = new ilRadioOption($this->lng->txt('ecs_cmap_att_'.$subdir_name),$subdir_name);
344 $dir_relation->addOption($subdir);
345 }
346 if($upper_attributes)
347 {
348 $dir_relation->setValue((string) $rule->getDirectory());
349 $form->addItem($dir_relation);
350 }
351 */
352 }
353
354 // add list of attributes
355 $hidden_atts = new ilHiddenInputGUI('attributes');
356 $hidden_atts->setValue(implode(',',$attributes));
357 $form->addItem($hidden_atts);
358
359
360 if($current_attribute)
361 {
362 $form->addCommandButton('cSaveOverview',$this->lng->txt('save'));
363 }
364
365 if($attributes_obj->getNextAttributeName($current_attribute))
366 {
367 $form->addCommandButton('cAddAttribute', $this->lng->txt('ecs_cmap_add_attribute_btn'));
368 }
369 if($attributes_obj->getPreviousAttributeName($current_attribute))
370 {
371 $form->addCommandButton('cDeleteAttribute', $this->lng->txt('ecs_cmap_delete_attribute_btn'));
372 }
374 $this->getServer()->getServerId(),
375 $this->getMid(),
376 $current_node
377 ))
378 {
379 $form->addCommandButton('cDeleteRulesOfNode', $this->lng->txt('ecs_cmap_delete_rule'));
380 }
381
382 #$form->addCommandButton('cInitOverview', $this->lng->txt('cancel'));
383
384 $form->setShowTopButtons(false);
385
386 return $form;
387 }
$section
Definition: Utf8Test.php:84
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 148 of file class.ilECSMappingSettingsGUI.php.

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

References $_REQUEST, $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 392 of file class.ilECSMappingSettingsGUI.php.

393 {
394 $current_node = (int) $_REQUEST['lnodes'];
395 $current_att = (string) $_REQUEST['ecs_ca'];
396 $form = $this->cInitMappingForm($current_node, $current_att);
397
398 if($form->checkInput())
399 {
400 // save ...
401 $all_attributes = explode(',',$form->getInput('attributes'));
402 foreach((array) $all_attributes as $att_name)
403 {
405 $this->getServer()->getServerId(),
406 $this->getMid(),
407 $current_node,
408 $att_name);
409 $rule->setServerId($this->getServer()->getServerId());
410 $rule->setMid($this->getMid());
411 $rule->setRefId($current_node);
412 $rule->setAttribute($att_name);
413 $rule->enableFilter($form->getInput($att_name.'_is_filter'));
414 $rule->setFilter($form->getInput($att_name.'_filter'));
415 $rule->enableSubdirCreation($form->getInput($att_name.'_subdirs'));
416 //$rule->setSubDirectoryType($form->getInput($att_name.'_subdir_type'));
417 //$rule->setDirectory($form->getInput($att_name.'_dir_relation'));
418
419 if($rule->getRuleId())
420 {
421 $rule->update();
422 }
423 else
424 {
425 $rule->save();
426 }
427 }
428
429 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
430 $this->ctrl->setParameter($this,'lnodes',$current_node);
431 $this->ctrl->redirect($this,'cInitOverview');
432 }
433
434 $form->setValuesByPost();
435 ilUtil::sendFailure($this->lng->txt('err_check_input'));
436 $this->cInitOverview($form, $current_att);
437 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_REQUEST, 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 466 of file class.ilECSMappingSettingsGUI.php.

467 {
468 global $ilTabs;
469
470 $this->setSubTabs(self::TAB_COURSE);
471 $ilTabs->activateTab('ecs_crs_allocation');
472 $ilTabs->activateSubTab('cSettings');
473
474 if(!$form instanceof ilPropertyFormGUI)
475 {
476 $form = $this->initFormCSettings();
477 }
478
479 $GLOBALS['tpl']->setContent($form->getHTML());
480
481 return true;
482 }

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 224 of file class.ilECSMappingSettingsGUI.php.

225 {
226 global $tree;
227
228 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
229 $explorer = new ilECSNodeMappingLocalExplorer(
230 $this->ctrl->getLinkTarget($this,'cInitOverview'),
231 $this->getServer()->getServerId(),
232 $this->getMid()
233 );
234 $explorer->setPostVar('lnodes[]');
235
236 $lnodes = (array) $_REQUEST['lnodes'];
237 $checked_node = array_pop($lnodes);
238 if((int) $_REQUEST['lid'])
239 {
240 $checked_node = (int) $_REQUEST['lid'];
241 }
242
243 if($checked_node)
244 {
245 $explorer->setCheckedItems(array($checked_node));
246 }
247 else
248 {
249 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
250 }
251 $explorer->setTargetGet('lref_id');
252 $explorer->setSessionExpandVariable('lexpand');
253 $explorer->setExpand((int) $_GET['lexpand']);
254 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this,'cInitOverview'));
255 $explorer->setOutput(0);
256 return $explorer;
257 }
$_GET["client_id"]

References $_GET, and $_REQUEST.

Referenced by cInitOverview().

+ Here is the caller graph for this function:

◆ cStart()

ilECSMappingSettingsGUI::cStart ( )
protected

Goto default page.

Returns
<type>

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

122 {
123 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
124 if(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isCourseAllocationEnabled())
125 {
126 return $this->cInitOverview();
127 }
128 return $this->cSettings();
129 }
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 627 of file class.ilECSMappingSettingsGUI.php.

628 {
629 $form = $this->initFormCSettings();
630 if($form->checkInput())
631 {
632 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
633 $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid());
634 $settings->enableCourseAllocation($form->getInput('enabled'));
635 $settings->setDefaultCourseCategory($form->getInput('default_cat'));
636 $settings->enableAllInOne($form->getInput('allinone'));
637 $settings->setAllInOneCategory($form->getInput('allinone_cat'));
638 $settings->enableAttributeMapping($form->getInput('multiple'));
639
640 $role_mappings = array();
641 foreach(ilECSMappingUtils::getRoleMappingInfo() as $name => $info)
642 {
643 $role_mappings[$name] = $form->getInput($name);
644 }
645 $settings->setRoleMappings($role_mappings);
646 $settings->update();
647
648 // store attribute settings
649 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
650 $attributes = new ilECSCourseAttributes($this->getServer()->getServerId(),$this->getMid());
651 $attributes->delete();
652
653 $form_atts = $form->getInput('atts');
654
655 foreach($form_atts as $name)
656 {
657 if(!$name)
658 {
659 continue;
660 }
661
662 $att = new ilECSCourseAttribute();
663 $att->setServerId($this->getServer()->getServerId());
664 $att->setMid($this->getMid());
665 $att->setName($name);
666 $att->save();
667 }
668
669 //$att = new ilECSCourseAttribute();
670 //$att->setName($a_name)
671
672 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
673 $GLOBALS['ilCtrl']->redirect($this,'cSettings');
674 }
675 ilUtil::sendFailure($this->lng->txt('err_check_input'));
676 $form->setValuesByPost();
677 $this->cSettings($form);
678 }
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 794 of file class.ilECSMappingSettingsGUI.php.

795 {
796 $this->setSubTabs(self::TAB_DIRECTORY);
797 $GLOBALS['ilTabs']->activateSubTab('dTrees');
798 $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
799
800 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
801 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
802
803 $confirm = new ilConfirmationGUI();
804 $confirm->setFormAction($this->ctrl->getFormAction($this));
805 $confirm->setHeaderText($this->lng->txt('ecs_confirm_delete_tree'));
806
807 $confirm->addItem(
808 'tid',
809 (int) $_REQUEST['tid'],
811 $this->getServer()->getServerId(),
812 $this->getMid(),
813 (int) $_REQUEST['tid']
814 )
815 );
816 $confirm->setConfirm($this->lng->txt('delete'), 'dDeleteTree');
817 $confirm->setCancel($this->lng->txt('cancel'), 'dTrees');
818
819 $GLOBALS['tpl']->setContent($confirm->getHTML());
820 }
Confirmation screen class.
static lookupTitle($a_server_id, $a_mid, $a_tree_id)
Lookup title by obj id.

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

+ Here is the call graph for this function:

◆ dDeleteTree()

ilECSMappingSettingsGUI::dDeleteTree ( )
protected

Delete tree.

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

826 {
827 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
828 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
829
830 $GLOBALS['ilLog']->write('Deleting tree');
831
832 $tree = new ilECSCmsTree((int) $_REQUEST['tid']);
833 $tree->deleteTree($tree->getNodeData(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
834
835
836
837 // also delete import information
838 include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
840 $this->getServer()->getServerId(),
841 $this->getMid(),
843 $this->getServer()->getServerId(),
844 $this->getMid(),
845 (int) $_REQUEST['tid']
846 )
847 );
848
849 $data = new ilECSCmsData();
850 $data->setServerId($this->getServer()->getServerId());
851 $data->setMid($this->getMid());
852 $data->setTreeId((int) $_REQUEST['tid']);
853 $data->deleteTree();
854
855
856 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
858 $this->getServer()->getServerId(),
859 $this->getMid(),
860 (int) $_REQUEST['tid']
861 );
862
863 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_deleted'),true);
864 $this->ctrl->redirect($this,'dTrees');
865 }
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.
$data

References $_REQUEST, $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 870 of file class.ilECSMappingSettingsGUI.php.

871 {
872 $GLOBALS['tpl']->addBlockFile('ADM_CONTENT','adm_content','tpl.ecs_edit_tree.html','Services/WebServices/ECS');
873
874 $this->ctrl->saveParameter($this,'cid');
875
876 $GLOBALS['ilTabs']->clearTargets();
877 $GLOBALS['ilTabs']->setBack2Target(
878 $this->lng->txt('ecs_back_settings'),
879 $this->ctrl->getLinkTarget($this,'cancel')
880 );
881 $GLOBALS['ilTabs']->setBackTarget(
882 $this->lng->txt('ecs_cms_dir_tree'),
883 $this->ctrl->getLinkTarget($this,'dTrees')
884 );
885
886 $GLOBALS['tpl']->setVariable('LEGEND',$GLOBALS['lng']->txt('ecs_status_legend'));
887 $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED',$GLOBALS['lng']->txt('ecs_status_pending_unmapped'));
888 $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED_DISCON',$GLOBALS['lng']->txt('ecs_status_pending_unmapped_discon'));
889 $GLOBALS['tpl']->setVariable('PENDING_UNMAPPED_NONDISCON',$GLOBALS['lng']->txt('ecs_status_pending_unmapped_nondiscon'));
890 $GLOBALS['tpl']->setVariable('MAPPED',$GLOBALS['lng']->txt('ecs_status_mapped'));
891 $GLOBALS['tpl']->setVariable('DELETED',$GLOBALS['lng']->txt('ecs_status_deleted'));
892
893 $form = $this->dInitFormTreeSettings($form);
894 $GLOBALS['tpl']->setVariable('GENERAL_FORM',$form->getHTML());
895 $GLOBALS['tpl']->setVariable('TFORM_ACTION',$this->ctrl->getFormAction($this,'dEditTree'));
896
897 $explorer = $this->dShowLocalExplorer();
898 $this->dShowCmsExplorer($explorer);
899 }
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 1171 of file class.ilECSMappingSettingsGUI.php.

1172 {
1173 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
1175 $this->getServer()->getServerId(),
1176 $this->getMid(),
1177 (int) $_REQUEST['tid']
1178 );
1179 return $this->dEditTree();
1180 }
static updateStatus($a_server_id, $a_mid, $a_tree_id)
dEditTree(ilPropertyFormGUI $form=null)
Edit directory tree assignments.

References $_REQUEST, 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 904 of file class.ilECSMappingSettingsGUI.php.

905 {
906 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
907 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
908
909 if($form instanceof ilPropertyFormGUI)
910 {
911 return $form;
912 }
913
914 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
915 $assignment = new ilECSNodeMappingAssignment(
916 $this->getServer()->getServerId(),
917 $this->getMid(),
918 (int) $_REQUEST['tid'],
919 0
920 );
921
922 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
923 $form = new ilPropertyFormGUI();
924 $form->setFormAction($this->ctrl->getFormAction($this,'dEditTree'));
925 $form->setTitle($this->lng->txt('general_settings'));
926 $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
927 $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
928 $form->setTableWidth('30%');
929
930 // CMS id (readonly)
931 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
932 $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
933 $cmsid->setValue(
935 );
936 $cmsid->setDisabled(true);
937 $cmsid->setSize(7);
938 $cmsid->setMaxLength(12);
939 $form->addItem($cmsid);
940
941
943 $this->getServer()->getServerId(),
944 $this->getMid(),
945 (int) $_REQUEST['tid']);
946 $mapping_advanced = ($mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false);
947
948 // Status (readonly)
949 $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
950 $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
951 $form->addItem($status);
952
953 // title update
954 $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
955 $title->setValue(1);
956 $title->setChecked($assignment->isTitleUpdateEnabled());
957 #$title->setInfo($this->lng->txt('ecs_title_update_info'));
958 $form->addItem($title);
959
960
961 $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
962 $position->setDisabled(!$mapping_advanced);
963 $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
964 $position->setValue(1);
965 #$position->setInfo($this->lng->txt('ecs_position_update_info'));
966 $form->addItem($position);
967
968 $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
969 $tree->setDisabled(!$mapping_advanced);
970 $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
971 $tree->setValue(1);
972 #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
973 $form->addItem($tree);
974
975 return $form;
976 }
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).
setTableWidth($a_width)
Set table width.
addCommandButton($a_cmd, $a_text)
Add Command button.
setTitle($a_title)
Set Title.

References $_REQUEST, 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 1186 of file class.ilECSMappingSettingsGUI.php.

1187 {
1188 if(!$_POST['lnodes'])
1189 {
1190 ilUtil::sendFailure($this->lng->txt('select_one'),true);
1191 $this->ctrl->redirect($this,'dEditTree');
1192 }
1193
1194 $ref_id = end($_POST['lnodes']);
1195
1196 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1198 $this->getServer()->getServerId(),
1199 $this->getMid(),
1200 (int) $_REQUEST['tid'],
1201 $ref_id
1202 );
1203
1204
1205 $nodes = (array) $_POST['rnodes'];
1206 $nodes = (array) array_reverse($nodes);
1207
1208 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
1209 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1210 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1211 foreach($nodes as $cms_id)
1212 {
1213 $assignment = new ilECSNodeMappingAssignment(
1214 $this->getServer()->getServerId(),
1215 $this->getMid(),
1216 (int) $_REQUEST['tid'],
1217 (int) $cms_id
1218 );
1219 $assignment->setRefId($ref_id);
1220 $assignment->setObjId(ilObject::_lookupObjId($ref_id));
1221 $assignment->enablePositionUpdate(false);
1222 $assignment->enableTreeUpdate(false);
1223 $assignment->enableTitleUpdate(ilECSNodeMappingAssignments::lookupDefaultTitleUpdate(
1224 $this->getServer()->getServerId(),
1225 $this->getMid(),
1226 (int) $_REQUEST['tid']
1227 ));
1228 $assignment->update();
1229
1230 // Delete subitems mappings for cms subtree
1231 $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1232 $childs = $cmsTree->getSubTreeIds($cms_id);
1233
1235 $this->getServer()->getServerId(),
1236 $this->getMid(),
1237 (int) $_REQUEST['tid'],
1238 $childs
1239 );
1240
1241 }
1242
1244 $this->getServer()->getServerId(),
1245 $this->getMid(),
1246 (int) $_REQUEST['tid']
1247 );
1248
1249 // Save parameter cid
1250 $this->ctrl->setParameter($this,'lid',(int) $ref_id);
1251
1252 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1253 $this->ctrl->redirect($this,'dEditTree');
1254 }
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
$_POST['username']
Definition: cron.php:12
$ref_id
Definition: sahs_server.php:39

References $_POST, $_REQUEST, $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 1259 of file class.ilECSMappingSettingsGUI.php.

1260 {
1261 $this->setSubTabs(self::TAB_DIRECTORY);
1262 $GLOBALS['ilTabs']->activateSubTab('dMappingOverview');
1263 $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
1264 }

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 604 of file class.ilECSMappingSettingsGUI.php.

605 {
606 global $ilTabs;
607
608 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
609 $this->setSubTabs(self::TAB_DIRECTORY);
610 $ilTabs->activateTab('ecs_dir_allocation');
611 $ilTabs->activateSubTab('dSettings');
612
613 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
614 if(!$form instanceof ilPropertyFormGUI)
615 {
616 $form = $this->initFormDSettings();
617 }
618
619 $GLOBALS['tpl']->setContent($form->getHTML());
620
621 return true;
622 }

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 1100 of file class.ilECSMappingSettingsGUI.php.

1101 {
1102 global $tree;
1103
1104 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1105 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingCmsExplorer.php';
1106 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1107
1108 $explorer = new ilECSNodeMappingCmsExplorer(
1109 $this->ctrl->getLinkTarget($this,'dEditTree'),
1110 $this->getServer()->getServerId(),
1111 $this->getMid(),
1112 (int) $_REQUEST['tid']
1113 );
1114 $explorer->setRoot(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid']));
1115 $explorer->setTree(
1116 new ilECSCmsTree(
1117 (int) $_REQUEST['tid']
1118 )
1119 );
1120 $explorer->setPostVar('rnodes[]');
1121
1122 // Read checked items from mapping of checked items in local explorer
1123 $active_node = $tree->getRootId();
1124 foreach($localExplorer->getCheckedItems() as $ref_id)
1125 {
1126 $explorer->setCheckedItems(
1128 $this->getServer()->getServerId(),
1129 $this->getMid(),
1130 (int) $_REQUEST['tid'],
1131 $ref_id
1132 )
1133 );
1134 $active_node = $ref_id;
1135 }
1136
1137
1138 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
1139 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
1140 $cmsTree = new ilECSCmsTree((int) $_REQUEST['tid']);
1142 $this->getServer()->getServerId(),
1143 $this->getMid(),
1144 (int) $_REQUEST['tid'],
1145 $active_node
1146 ) as $cs_id)
1147 {
1148 foreach($cmsTree->getPathId($cs_id) as $path_id)
1149 {
1150 #$explorer->setExpand($path_id);
1151 }
1152 }
1153
1154 $explorer->setTargetGet('rref_id');
1155 $explorer->setSessionExpandVariable('rexpand');
1156
1157 #if((int) $_REQUEST['rexpand'])
1158 {
1159 $explorer->setExpand((int) $_GET['rexpand']);
1160 }
1161 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this,'dEditTree'));
1162 $explorer->setOutput(0);
1163 $GLOBALS['tpl']->setVariable('REMOTE_EXPLORER',$explorer->getOutput());
1164
1165 }
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, $_REQUEST, $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 1060 of file class.ilECSMappingSettingsGUI.php.

1061 {
1062 global $tree;
1063
1064 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
1065 $explorer = new ilECSNodeMappingLocalExplorer(
1066 $this->ctrl->getLinkTarget($this,'dEditTree'),
1067 $this->getServer()->getServerId(),
1068 $this->getMid()
1069 );
1070 $explorer->setPostVar('lnodes[]');
1071
1072 $lnodes = (array) $_REQUEST['lnodes'];
1073 $checked_node = array_pop($lnodes);
1074 if((int) $_REQUEST['lid'])
1075 {
1076 $checked_node = (int) $_REQUEST['lid'];
1077 }
1078
1079 if($checked_node)
1080 {
1081 $explorer->setCheckedItems(array($checked_node));
1082 }
1083 else
1084 {
1085 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
1086 }
1087 $explorer->setTargetGet('lref_id');
1088 $explorer->setSessionExpandVariable('lexpand');
1089 $explorer->setExpand((int) $_GET['lexpand']);
1090 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this,'dEditTree'));
1091 $explorer->setOutput(0);
1092 $GLOBALS['tpl']->setVariable('LOCAL_EXPLORER',$explorer->getOutput());
1093
1094 return $explorer;
1095 }

References $_GET, $_REQUEST, 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 135 of file class.ilECSMappingSettingsGUI.php.

136 {
137 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
138 if(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isDirectoryMappingEnabled())
139 {
140 return $this->dTrees();
141 }
142 return $this->dSettings();
143 }
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 1016 of file class.ilECSMappingSettingsGUI.php.

1017 {
1018 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTreeSynchronizer.php';
1019 $sync = new ilECSCmsTreeSynchronizer(
1020 $this->getServer(),
1021 $this->mid,
1022 (int) $_REQUEST['tid']
1023 );
1024 $sync->sync();
1025 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_synchronized'),true);
1026 $this->ctrl->redirect($this,'dTrees');
1027 }

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

+ Here is the call graph for this function:

◆ dSynchronizeTrees()

ilECSMappingSettingsGUI::dSynchronizeTrees ( )
protected

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

1030 {
1031 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
1032
1033 try
1034 {
1035 $connector = new ilECSDirectoryTreeConnector($this->getServer());
1036 $res = $connector->getDirectoryTrees();
1037 foreach((array) $res->getLinkIds() as $cms_id)
1038 {
1039 include_once './Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
1040 include_once './Services/WebServices/ECS/classes/class.ilECSEvent.php';
1041 $event = new ilECSEventQueueReader($this->getServer()->getServerId());
1042 $event->add(
1044 $cms_id,
1046 );
1047 }
1048 $this->ctrl->redirect($this,'dTrees');
1049 }
1050 catch(Exception $e)
1051 {
1052 ilUtil::sendFailure($e->getMessage(),true);
1053 $this->ctrl->redirect($this,'dTrees');
1054 }
1055 }
Reads ECS events and stores them in the database.

References $res, 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 765 of file class.ilECSMappingSettingsGUI.php.

766 {
767 global $ilToolbar;
768
769 $this->setSubTabs(self::TAB_DIRECTORY);
770 $GLOBALS['ilTabs']->activateSubTab('dTrees');
771 $GLOBALS['ilTabs']->activateTab('ecs_dir_allocation');
772
773 $ilToolbar->addButton(
774 $this->lng->txt('ecs_sync_trees'),
775 $this->ctrl->getLinkTarget($this, 'dSynchronizeTrees'));
776
777 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingTreeTableGUI.php';
778
779 $dtreeTable = new ilECSNodeMappingTreeTableGUI(
780 $this->getServer()->getServerId(),
781 $this->getMid(),
782 $this,
783 'dtree');
784
785
786 $dtreeTable->parse();
787 $GLOBALS['tpl']->setContent($dtreeTable->getHTML());
788 return true;
789 }

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 713 of file class.ilECSMappingSettingsGUI.php.

714 {
715 global $ilCtrl;
716
717 $form = $this->initFormDSettings();
718 if($form->checkInput())
719 {
720 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
721 $settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid());
722 $settings->enableDirectoryMapping((bool) $form->getInput('active'));
723 $settings->enableEmptyContainerCreation(!$form->getInput('empty'));
724 $settings->update();
725 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
726 }
727 else
728 {
729 ilUtil::sendFailure($this->lng->txt('err_check_input'),true);
730 $form->setValuesByPost();
731 }
732 $ilCtrl->redirect($this,'dSettings');
733 }

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 982 of file class.ilECSMappingSettingsGUI.php.

983 {
984 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
985 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
986 $assignment = new ilECSNodeMappingAssignment(
987 $this->getServer()->getServerId(),
988 $this->getMid(),
989 (int) $_REQUEST['tid'],
990 0
991 );
992 $assignment->setRefId(0);
993 $assignment->setObjId(0);
994
995 $form = $this->dInitFormTreeSettings();
996 if($form->checkInput())
997 {
998 $assignment->enableTitleUpdate($form->getInput('title'));
999 $assignment->enableTreeUpdate($form->getInput('tree'));
1000 $assignment->enablePositionUpdate($form->getInput('position'));
1001 $assignment->update();
1002
1003 ilUtil::sendSuccess($this->lng->txt('settings_saved',true));
1004 $this->ctrl->redirect($this,'dEditTree');
1005 }
1006
1007 $form->setValuesByPost();
1008 ilUtil::sendFailure($this->lng->txt('err_check_input'));
1009 $this->dEditTree($form);
1010 return true;
1011 }

References $_REQUEST, 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 73 of file class.ilECSMappingSettingsGUI.php.

74 {
75 global $ilCtrl;
76
77 $GLOBALS['tpl']->setTitle($this->lng->txt('ecs_campus_connect_title'));
78
79 $this->ctrl->saveParameter($this,'server_id');
80 $this->ctrl->saveParameter($this,'mid');
81 $this->ctrl->saveParameter($this,'tid');
82
83 $next_class = $this->ctrl->getNextClass($this);
84 $cmd = $this->ctrl->getCmd();
85
86 $this->setTabs();
87 switch($next_class)
88 {
89 default:
90 if(!$cmd)
91 {
92 $cmd = "cStart";
93 }
94 $this->$cmd();
95 break;
96 }
97
98 $GLOBALS['tpl']->setTitle($this->getServer()->getTitle());
99 $GLOBALS['tpl']->setDescription('');
100
101 return true;
102 }
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 47 of file class.ilECSMappingSettingsGUI.php.

References $container.

◆ getMid()

◆ getServer()

◆ initFormCSettings()

ilECSMappingSettingsGUI::initFormCSettings ( )
protected

Init settings form.

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

488 {
489 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
490
491 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
492 $form = new ilPropertyFormGUI();
493 $form->setFormAction($this->ctrl->getFormAction($this));
494 $form->setTitle($this->lng->txt('settings'));
495
496 // individual course allocation
497 $check = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_enable'), 'enabled');
498 $check->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isCourseAllocationEnabled());
499 $form->addItem($check);
500
501
502 // add default container
503 $imp = new ilCustomInputGUI($this->lng->txt('ecs_cmap_def_cat'),'default_cat');
504 $imp->setRequired(true);
505
506 $tpl = new ilTemplate('tpl.ecs_import_id_form.html',true,true,'Services/WebServices/ECS');
507 $tpl->setVariable('SIZE',5);
508 $tpl->setVariable('MAXLENGTH',11);
509 $tpl->setVariable('POST_VAR','default_cat');
510
511 $default = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->getDefaultCourseCategory();
512 $tpl->setVariable('PROPERTY_VALUE',$default);
513
514 if($default)
515 {
516 include_once './Services/Tree/classes/class.ilPathGUI.php';
517 $path = new ilPathGUI();
518 $path->enableTextOnly(false);
519 $path->enableHideLeaf(false);
520 $tpl->setVariable('COMPLETE_PATH',$path->getPath(ROOT_FOLDER_ID, $default));
521 }
522
523 $imp->setHtml($tpl->get());
524 $imp->setInfo($this->lng->txt('ecs_cmap_def_cat_info'));
525 $form->addItem($imp);
526
527 // all in one category
528 $allinone = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_all_in_one'),'allinone');
529 $allinone->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isAllInOneCategoryEnabled());
530 $allinone->setInfo($this->lng->txt('ecs_cmap_all_in_one_info'));
531
532 $allinone_cat = new ilCustomInputGUI($this->lng->txt('ecs_cmap_all_in_one_cat'),'allinone_cat');
533 $allinone_cat->setRequired(true);
534
535 $tpl = new ilTemplate('tpl.ecs_import_id_form.html',true,true,'Services/WebServices/ECS');
536 $tpl->setVariable('SIZE',5);
537 $tpl->setVariable('MAXLENGTH',11);
538 $tpl->setVariable('POST_VAR','allinone_cat');
539
540 $cat = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->getAllInOneCategory();
541 $tpl->setVariable('PROPERTY_VALUE',$cat);
542 if($cat)
543 {
544 include_once './Services/Tree/classes/class.ilPathGUI.php';
545 $path = new ilPathGUI();
546 $path->enableTextOnly(false);
547 $path->enableHideLeaf(false);
548 $tpl->setVariable('COMPLETE_PATH',$path->getPath(ROOT_FOLDER_ID, $default));
549 }
550
551 $allinone_cat->setHtml($tpl->get());
552 $allinone->addSubItem($allinone_cat);
553 $form->addItem($allinone);
554
555 // multiple attributes
556 $multiple = new ilCheckboxInputGUI($this->lng->txt('ecs_cmap_multiple_atts'),'multiple');
557 $multiple->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isAttributeMappingEnabled());
558
559 // attribute selection
560 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
561 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
562 $attributes = new ilSelectInputGUI($this->lng->txt('ecs_cmap_attributes'),'atts');
563 $attributes->setMulti(true);
564 $attributes->setValue(
566 $this->getServer()->getServerId(),
567 $this->getMid()
568 )->getAttributeValues());
569 $attributes->setRequired(true);
571 $multiple->addSubItem($attributes);
572
573 $form->addItem($multiple);
574
575 // role mapping
576 $rm = new ilFormSectionHeaderGUI();
577 $rm->setTitle($this->lng->txt('ecs_role_mappings'));
578 $form->addItem($rm);
579
580 $mapping_defs = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->getRoleMappings();
581
582 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
583 foreach(ilECSMappingUtils::getRoleMappingInfo() as $name => $info)
584 {
585 $role_map = new ilTextInputGUI($this->lng->txt($info['lang']),$name);
586 $role_map->setValue($mapping_defs[$name]);
587 $role_map->setSize(32);
588 $role_map->setMaxLength(64);
589 $role_map->setRequired($info['required']);
590 $form->addItem($role_map);
591 }
592
593
594 $form->addCommandButton('cUpdateSettings',$this->lng->txt('save'));
595 $form->addCommandButton('cSettings', $this->lng->txt('cancel'));
596
597 return $form;
598 }
global $tpl
Definition: ilias.php:8
This class represents a custom property in a property form.
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
$path
Definition: index.php:22

References $info, $path, $tpl, 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 738 of file class.ilECSMappingSettingsGUI.php.

739 {
740 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
741 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
742
743 $form = new ilPropertyFormGUI();
744 $form->setFormAction($this->ctrl->getFormAction($this));
745 $form->setTitle($this->lng->txt('general_settings'));
746
747 $active = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_activate'), 'active');
748 $active->setChecked(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isDirectoryMappingEnabled());
749 $form->addItem($active);
750
751 $create_empty = new ilCheckboxInputGUI($this->lng->txt('ecs_node_mapping_create_empty'), 'empty');
752 $create_empty->setChecked(!ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isEmptyContainerCreationEnabled());
753 $create_empty->setInfo($this->lng->txt('ecs_node_mapping_create_empty_info'));
754 $form->addItem($create_empty);
755
756 $form->addCommandButton('dUpdateSettings',$this->lng->txt('save'));
757 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
758
759 return $form;
760 }

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 1305 of file class.ilECSMappingSettingsGUI.php.

1306 {
1307 global $ilTabs;
1308
1309 if($a_tab == self::TAB_DIRECTORY)
1310 {
1311 $ilTabs->addSubTab(
1312 'dMappingOverview',
1313 $this->lng->txt('ecs_cc_mapping_overview'),
1314 $this->ctrl->getLinkTarget($this,'dMappingOverview')
1315 );
1316 $ilTabs->addSubTab(
1317 'dTrees',
1318 $this->lng->txt('ecs_cms_dir_tree'),
1319 $this->ctrl->getLinkTarget($this,'dTrees')
1320 );
1321 $ilTabs->addSubTab(
1322 'dSettings',
1323 $this->lng->txt('settings'),
1324 $this->ctrl->getLinkTarget($this,'dSettings')
1325 );
1326 }
1327 if($a_tab == self::TAB_COURSE)
1328 {
1329 // Check if attributes are available
1330 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
1331 $atts = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
1332
1333 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
1334 if(ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(),$this->getMid())->isCourseAllocationEnabled())
1335 {
1336 $ilTabs->addSubTab(
1337 'cInitTree',
1338 $this->lng->txt('ecs_cmap_overview'),
1339 $this->ctrl->getLinkTarget($this,'cInitOverview')
1340 );
1341 }
1342
1343 $ilTabs->addSubTab(
1344 'cSettings',
1345 $this->lng->txt('settings'),
1346 $this->ctrl->getLinkTarget($this,'cSettings')
1347 );
1348
1349 }
1350 }

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 1272 of file class.ilECSMappingSettingsGUI.php.

1273 {
1274 global $ilTabs;
1275
1276 include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
1277
1278 $ilTabs->clearTargets();
1279 $ilTabs->setBackTarget(
1280 $this->lng->txt('ecs_back_settings'),
1281 $this->ctrl->getParentReturn($this)
1282 );
1283 // Directories are only visible for import type campus managment.
1284 if(ilECSParticipantSettings::loookupCmsMid($this->getServer()->getServerId()) == $this->getMid())
1285 {
1286 $ilTabs->addTab(
1287 'ecs_dir_allocation',
1288 $this->lng->txt('ecs_dir_alloc'),
1289 $this->ctrl->getLinkTarget($this,'dSettings')
1290 );
1291 }
1292
1293 $ilTabs->addTab(
1294 'ecs_crs_allocation',
1295 $this->lng->txt('ecs_crs_alloc'),
1296 $this->ctrl->getLinkTarget($this,'cStart')
1297 );
1298 }
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 20 of file class.ilECSMappingSettingsGUI.php.

Referenced by getContainer().

◆ $ctrl

ilECSMappingSettingsGUI::$ctrl = null
protected

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

◆ $lng

ilECSMappingSettingsGUI::$lng = null
protected

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

Referenced by __construct().

◆ $mid

ilECSMappingSettingsGUI::$mid = null
private

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

Referenced by __construct(), and getMid().

◆ $server

ilECSMappingSettingsGUI::$server = null
private

Definition at line 21 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: