ILIAS  release_7 Revision v7.30-3-g800a261c036
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 $DIC;
39
40 $lng = $DIC['lng'];
41 $ilCtrl = $DIC['ilCtrl'];
42
43 $this->log = $GLOBALS['DIC']->logger()->wsrv();
44
45 $this->container = $settingsContainer;
46 $this->server = ilECSSetting::getInstanceByServerId($server_id);
47 $this->mid = $mid;
48 $this->lng = $lng;
49 $this->lng->loadLanguageModule('ecs');
50 $this->ctrl = $ilCtrl;
51 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
global $DIC
Definition: goto.php:24

References $DIC, $GLOBALS, $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 117 of file class.ilECSMappingSettingsGUI.php.

118 {
119 $GLOBALS['DIC']['ilCtrl']->returnToParent($this);
120 }

References $GLOBALS.

◆ cAttributes()

ilECSMappingSettingsGUI::cAttributes ( )
protected

Show active attributes @global ilTabsGUI $ilTabs.

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

685 {
686 global $DIC;
687
688 $ilTabs = $DIC['ilTabs'];
689
690 $this->setSubTabs(self::TAB_COURSE);
691 $ilTabs->setTabActive('ecs_crs_allocation');
692 $ilTabs->setSubTabActive('cAttributes');
693
694 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributesTableGUI.php';
695 $table = new ilECSCourseAttributesTableGUI(
696 $this,
697 'attributes',
698 $this->getServer()->getServerId(),
699 $this->getMid()
700 );
701 $table->init();
702 $table->parse(
704 $this->getServer()->getServerId(),
705 $this->getMid()
706 )->getAttributes()
707 );
708
709 $GLOBALS['DIC']['tpl']->setContent($table->getHTML());
710 }
setSubTabs($a_tab)
Set Sub tabs @global ilTabsGUI $ilTabs.

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

436 {
437 $current_node = (int) $_REQUEST['lnodes'];
438
439 include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseMappingRule.php';
441 $this->getServer()->getServerId(),
442 $this->getMid(),
443 $current_node
444 );
445
446 foreach ($rules as $rid) {
447 $rule = new ilECSCourseMappingRule($rid);
448 $rule->delete();
449 }
450 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
451 $this->ctrl->redirect($this, 'cInitOverview');
452 }
static getRulesOfRefId($a_sid, $a_mid, $a_ref_id)
Get all rule of ref_id @global type $ilDB.

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

+ Here is the call graph for this function:

◆ cInitMappingForm()

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

Init the mapping form.

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

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

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

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

References $DIC, $GLOBALS, cInitMappingForm(), cShowLocalExplorer(), getMid(), getServer(), ilECSCourseMappingRule\lookupLastExistingAttribute(), ROOT_FOLDER_ID, 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 // save ...
400 $all_attributes = explode(',', $form->getInput('attributes'));
401 foreach ((array) $all_attributes as $att_name) {
403 $this->getServer()->getServerId(),
404 $this->getMid(),
405 $current_node,
406 $att_name
407 );
408 $rule->setServerId($this->getServer()->getServerId());
409 $rule->setMid($this->getMid());
410 $rule->setRefId($current_node);
411 $rule->setAttribute($att_name);
412 $rule->enableFilter($form->getInput($att_name . '_is_filter'));
413 $rule->setFilter($form->getInput($att_name . '_filter'));
414 $rule->enableSubdirCreation($form->getInput($att_name . '_subdirs'));
415 //$rule->setSubDirectoryType($form->getInput($att_name.'_subdir_type'));
416 //$rule->setDirectory($form->getInput($att_name.'_dir_relation'));
417
418 if ($rule->getRuleId()) {
419 $rule->update();
420 } else {
421 $rule->save();
422 }
423 }
424
425 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
426 $this->ctrl->setParameter($this, 'lnodes', $current_node);
427 $this->ctrl->redirect($this, 'cInitOverview');
428 }
429
430 $form->setValuesByPost();
431 ilUtil::sendFailure($this->lng->txt('err_check_input'));
432 $this->cInitOverview($form, $current_att);
433 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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

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

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

References $DIC, $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 $DIC;
234
235 $tree = $DIC['tree'];
236
237 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingLocalExplorer.php';
238 $explorer = new ilECSNodeMappingLocalExplorer(
239 $this->ctrl->getLinkTarget($this, 'cInitOverview'),
240 $this->getServer()->getServerId(),
241 $this->getMid()
242 );
243 $explorer->setPostVar('lnodes[]');
244
245 $lnodes = (array) $_REQUEST['lnodes'];
246 $checked_node = array_pop($lnodes);
247 if ((int) $_REQUEST['lid']) {
248 $checked_node = (int) $_REQUEST['lid'];
249 }
250
251 if ($checked_node) {
252 $explorer->setCheckedItems(array($checked_node));
253 } else {
254 $explorer->setCheckedItems(array(ROOT_FOLDER_ID));
255 }
256 $explorer->setTargetGet('lref_id');
257 $explorer->setSessionExpandVariable('lexpand');
258 $explorer->setExpand((int) $_GET['lexpand']);
259 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, 'cInitOverview'));
260 $explorer->setOutput(0);
261 return $explorer;
262 }
$_GET["client_id"]

References $_GET, $DIC, and ROOT_FOLDER_ID.

Referenced by cInitOverview().

+ Here is the caller graph for this function:

◆ cStart()

ilECSMappingSettingsGUI::cStart ( )
protected

Goto default page.

Returns
<type>

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

132 {
133 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
134 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()) {
135 return $this->cInitOverview();
136 }
137 return $this->cSettings();
138 }
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 629 of file class.ilECSMappingSettingsGUI.php.

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

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

+ Here is the call graph for this function:

◆ dConfirmDeleteTree()

ilECSMappingSettingsGUI::dConfirmDeleteTree ( )
protected

Delete tree settings.

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

802 {
803 $this->setSubTabs(self::TAB_DIRECTORY);
804 $GLOBALS['DIC']['ilTabs']->activateSubTab('dTrees');
805 $GLOBALS['DIC']['ilTabs']->activateTab('ecs_dir_allocation');
806
807 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
808 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
809
810 $confirm = new ilConfirmationGUI();
811 $confirm->setFormAction($this->ctrl->getFormAction($this));
812 $confirm->setHeaderText($this->lng->txt('ecs_confirm_delete_tree'));
813
814 $confirm->addItem(
815 'tid',
816 (int) $_REQUEST['tid'],
818 $this->getServer()->getServerId(),
819 $this->getMid(),
820 (int) $_REQUEST['tid']
821 )
822 );
823 $confirm->setConfirm($this->lng->txt('delete'), 'dDeleteTree');
824 $confirm->setCancel($this->lng->txt('cancel'), 'dTrees');
825
826 $GLOBALS['DIC']['tpl']->setContent($confirm->getHTML());
827 }
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 832 of file class.ilECSMappingSettingsGUI.php.

833 {
834 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
835 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
836
837 $GLOBALS['DIC']['ilLog']->write('Deleting tree');
838
839 $tree = new ilECSCmsTree((int) $_REQUEST['tid']);
840 $tree->deleteTree($tree->getNodeData(ilECSCmsTree::lookupRootId((int) $_REQUEST['tid'])));
841
842
843
844 // also delete import information
845 include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
847 $this->getServer()->getServerId(),
848 $this->getMid(),
850 $this->getServer()->getServerId(),
851 $this->getMid(),
852 (int) $_REQUEST['tid']
853 )
854 );
855
856 $data = new ilECSCmsData();
857 $data->setServerId($this->getServer()->getServerId());
858 $data->setMid($this->getMid());
859 $data->setTreeId((int) $_REQUEST['tid']);
860 $data->deleteTree();
861
862
863 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
865 $this->getServer()->getServerId(),
866 $this->getMid(),
867 (int) $_REQUEST['tid']
868 );
869
870 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_deleted'), true);
871 $this->ctrl->redirect($this, 'dTrees');
872 }
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
Definition: storeScorm.php:23

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

+ Here is the call graph for this function:

◆ dEditTree()

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

Edit directory tree assignments.

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

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

1175 {
1176 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
1178 $this->getServer()->getServerId(),
1179 $this->getMid(),
1180 (int) $_REQUEST['tid']
1181 );
1182 return $this->dEditTree();
1183 }
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 911 of file class.ilECSMappingSettingsGUI.php.

912 {
913 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingUtils.php';
914 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
915
916 if ($form instanceof ilPropertyFormGUI) {
917 return $form;
918 }
919
920 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
921 $assignment = new ilECSNodeMappingAssignment(
922 $this->getServer()->getServerId(),
923 $this->getMid(),
924 (int) $_REQUEST['tid'],
925 0
926 );
927
928 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
929 $form = new ilPropertyFormGUI();
930 $form->setFormAction($this->ctrl->getFormAction($this, 'dEditTree'));
931 $form->setTitle($this->lng->txt('general_settings'));
932 $form->addCommandButton('dUpdateTreeSettings', $this->lng->txt('save'));
933 $form->addCommandButton('dTrees', $this->lng->txt('cancel'));
934 $form->setTableWidth('30%');
935
936 // CMS id (readonly)
937 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
938 $cmsid = new ilNumberInputGUI($this->lng->txt('ecs_cms_id'), 'cmsid');
939 $cmsid->setValue(
941 );
942 $cmsid->setDisabled(true);
943 $cmsid->setSize(7);
944 $cmsid->setMaxLength(12);
945 $form->addItem($cmsid);
946
947
949 $this->getServer()->getServerId(),
950 $this->getMid(),
951 (int) $_REQUEST['tid']
952 );
953 $mapping_advanced = ($mapping_status != ilECSMappingUtils::MAPPED_MANUAL ? true : false);
954
955 // Status (readonly)
956 $status = new ilNonEditableValueGUI($this->lng->txt('status'), '');
957 $status->setValue(ilECSMappingUtils::mappingStatusToString($mapping_status));
958 $form->addItem($status);
959
960 // title update
961 $title = new ilCheckboxInputGUI($this->lng->txt('ecs_title_updates'), 'title');
962 $title->setValue(1);
963 $title->setChecked($assignment->isTitleUpdateEnabled());
964 #$title->setInfo($this->lng->txt('ecs_title_update_info'));
965 $form->addItem($title);
966
967
968 $position = new ilCheckboxInputGUI($this->lng->txt('ecs_position_updates'), 'position');
969 $position->setDisabled(!$mapping_advanced);
970 $position->setChecked($mapping_advanced && $assignment->isPositionUpdateEnabled());
971 $position->setValue(1);
972 #$position->setInfo($this->lng->txt('ecs_position_update_info'));
973 $form->addItem($position);
974
975 $tree = new ilCheckboxInputGUI($this->lng->txt('ecs_tree_updates'), 'tree');
976 $tree->setDisabled(!$mapping_advanced);
977 $tree->setChecked($mapping_advanced && $assignment->isTreeUpdateEnabled());
978 $tree->setValue(1);
979 #$tree->setInfo($this->lng->txt('ecs_tree_update_info'));
980 $form->addItem($tree);
981
982 return $form;
983 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.
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 getMid(), getServer(), ilECSCmsData\lookupCmsId(), ilECSMappingUtils\lookupMappingStatus(), ilECSCmsTree\lookupRootId(), ilECSMappingUtils\MAPPED_MANUAL, ilECSMappingUtils\mappingStatusToString(), and true.

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

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

References $_POST, ilObject\_lookupObjId(), ilECSNodeMappingAssignments\deleteDisconnectableMappings(), ilECSNodeMappingAssignments\deleteMappingsByCsId(), getMid(), getServer(), ilECSNodeMappingAssignments\lookupDefaultTitleUpdate(), ilUtil\sendFailure(), 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['DIC']['ilTabs']->activateSubTab('dMappingOverview');
1263 $GLOBALS['DIC']['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 605 of file class.ilECSMappingSettingsGUI.php.

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

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

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

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

References $_GET, $DIC, $GLOBALS, and ROOT_FOLDER_ID.

Referenced by dEditTree().

+ Here is the caller graph for this function:

◆ dStart()

ilECSMappingSettingsGUI::dStart ( )
protected

Goto default page.

Returns
<type>

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

145 {
146 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
147 if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isDirectoryMappingEnabled()) {
148 return $this->dTrees();
149 }
150 return $this->dSettings();
151 }
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 1022 of file class.ilECSMappingSettingsGUI.php.

1023 {
1024 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTreeSynchronizer.php';
1025 $sync = new ilECSCmsTreeSynchronizer(
1026 $this->getServer(),
1027 $this->mid,
1028 (int) $_REQUEST['tid']
1029 );
1030 $sync->sync();
1031 ilUtil::sendSuccess($this->lng->txt('ecs_cms_tree_synchronized'), true);
1032 $this->ctrl->redirect($this, 'dTrees');
1033 }

References getServer().

+ Here is the call graph for this function:

◆ dSynchronizeTrees()

ilECSMappingSettingsGUI::dSynchronizeTrees ( )
protected

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

1036 {
1037 include_once './Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
1038
1039 $this->log->dump('Start synchronizing cms directory trees');
1040
1041 try {
1042 $connector = new ilECSDirectoryTreeConnector($this->getServer());
1043 $res = $connector->getDirectoryTrees();
1044
1045 $this->log->dump($res, ilLogLevel::DEBUG);
1046
1047 foreach ((array) $res->getLinkIds() as $cms_id) {
1048 include_once './Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
1049 include_once './Services/WebServices/ECS/classes/class.ilECSEvent.php';
1050 $event = new ilECSEventQueueReader($this->getServer()->getServerId());
1051 $event->add(
1053 $cms_id,
1055 );
1056 }
1057 $this->ctrl->redirect($this, 'dTrees');
1058 } catch (Exception $e) {
1059 ilUtil::sendFailure($e->getMessage(), true);
1060 $this->ctrl->redirect($this, 'dTrees');
1061 }
1062 }
Reads ECS events and stores them in the database.
foreach($_POST as $key=> $value) $res

References Vendor\Package\$e, $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 768 of file class.ilECSMappingSettingsGUI.php.

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

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

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

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

+ Here is the call graph for this function:

◆ dUpdateTreeSettings()

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

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

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

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

+ Here is the call graph for this function:

◆ executeCommand()

ilECSMappingSettingsGUI::executeCommand ( )

ilCtrl executeCommand

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

84 {
85 global $DIC;
86
87 $ilCtrl = $DIC['ilCtrl'];
88
89 $GLOBALS['DIC']['tpl']->setTitle($this->lng->txt('ecs_campus_connect_title'));
90
91 $this->ctrl->saveParameter($this, 'server_id');
92 $this->ctrl->saveParameter($this, 'mid');
93 $this->ctrl->saveParameter($this, 'tid');
94
95 $next_class = $this->ctrl->getNextClass($this);
96 $cmd = $this->ctrl->getCmd();
97
98 $this->setTabs();
99 switch ($next_class) {
100 default:
101 if (!$cmd) {
102 $cmd = "cStart";
103 }
104 $this->$cmd();
105 break;
106 }
107
108 $GLOBALS['DIC']['tpl']->setTitle($this->getServer()->getTitle());
109 $GLOBALS['DIC']['tpl']->setDescription('');
110
111 return true;
112 }
setTabs()
Set tabs @global ilTabsGUI $ilTabs.

References $DIC, $GLOBALS, getServer(), and setTabs().

+ Here is the call graph for this function:

◆ getContainer()

ilECSMappingSettingsGUI::getContainer ( )

Get container object.

Returns
ilObjectGUI

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

References $container.

◆ getMid()

◆ getServer()

◆ initFormCSettings()

ilECSMappingSettingsGUI::initFormCSettings ( )
protected

Init settings form.

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

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

References $attributes, $name, $tpl, ilECSMappingUtils\getAuthModeSelection(), ilECSMappingUtils\getCourseMappingFieldSelectOptions(), ilECSCourseAttributes\getInstance(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), ilECSMappingUtils\getRoleMappingInfo(), getServer(), and ROOT_FOLDER_ID.

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

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

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

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

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

References $DIC, 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: