ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjCategoryGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once "./Services/Container/classes/class.ilContainerGUI.php";
6
20{
24 protected $nav_history;
25
29 protected $help;
30
31 public $ctrl;
32
33 const CONTAINER_SETTING_TAXBLOCK = "tax_sblock_";
34
39 public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
40 {
41 global $DIC;
42
43 $this->rbacsystem = $DIC->rbac()->system();
44 $this->nav_history = $DIC["ilNavigationHistory"];
45 $this->access = $DIC->access();
46 $this->ctrl = $DIC->ctrl();
47 $this->tabs = $DIC->tabs();
48 $this->help = $DIC["ilHelp"];
49 $this->lng = $DIC->language();
50 $this->user = $DIC->user();
51 $this->tree = $DIC->repositoryTree();
52 $this->error = $DIC["ilErr"];
53 $this->settings = $DIC->settings();
54 $this->tpl = $DIC["tpl"];
55 $this->toolbar = $DIC->toolbar();
56 $this->rbacreview = $DIC->rbac()->review();
57 $this->rbacadmin = $DIC->rbac()->admin();
58 //global $ilCtrl;
59
60 // CONTROL OPTIONS
61 //$this->ctrl =& $ilCtrl;
62 //$this->ctrl->saveParameter($this,array("ref_id","cmdClass"));
63 $GLOBALS['lng']->loadLanguageModule('cat');
64 $GLOBALS['lng']->loadLanguageModule('obj');
65
66 $this->type = "cat";
67 parent::__construct($a_data, (int) $a_id, $a_call_by_reference, false);
68
69 if (is_object($this->object)) {
70 include_once("./Services/Container/classes/class.ilContainer.php");
71 include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
72 $this->info_screen_enabled = ilContainer::_lookupContainerSetting(
73 $this->object->getId(),
75 true
76 );
77 }
78 }
79
80 public function executeCommand()
81 {
83 $ilNavigationHistory = $this->nav_history;
84 $ilAccess = $this->access;
85 $ilCtrl = $this->ctrl;
86 $ilTabs = $this->tabs;
87
88 $next_class = $this->ctrl->getNextClass($this);
89 $cmd = $this->ctrl->getCmd();
90
91 $header_action = true;
92 switch ($next_class) {
93
94 case strtolower(ilRepUtilGUI::class):
95 $ru = new \ilRepUtilGUI($this);
96 $this->ctrl->setReturn($this, 'trash');
97 $this->ctrl->forwardCommand($ru);
98 break;
99
100 case "ilobjusergui":
101 include_once('./Services/User/classes/class.ilObjUserGUI.php');
102
103 $this->tabs_gui->setTabActive('administrate_users');
104 if (!$_GET['obj_id']) {
105 $this->gui_obj = new ilObjUserGUI("", $_GET['ref_id'], true, false);
106 $this->gui_obj->setCreationMode($this->creation_mode);
107 $ret = &$this->ctrl->forwardCommand($this->gui_obj);
108 } else {
109 $this->gui_obj = new ilObjUserGUI("", $_GET['obj_id'], false, false);
110 $this->gui_obj->setCreationMode($this->creation_mode);
111 $ret = &$this->ctrl->forwardCommand($this->gui_obj);
112 }
113
114 $ilTabs->clearTargets();
115 $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
116 $ilHelp = $this->help;
117 $ilHelp->setScreenIdComponent("cat");
118 $ilHelp->setScreenId("administrate_user");
119 $ilHelp->setSubScreenId($ilCtrl->getCmd());
120 break;
121
122 case "ilobjuserfoldergui":
123 include_once('./Services/User/classes/class.ilObjUserFolderGUI.php');
124
125 $this->gui_obj = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
126 $this->gui_obj->setUserOwnerId((int) $_GET['ref_id']);
127 $this->gui_obj->setCreationMode($this->creation_mode);
128 $ret = &$this->ctrl->forwardCommand($this->gui_obj);
129
130 $ilTabs->clearTargets();
131 $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
132 $ilHelp = $this->help;
133 $ilHelp->setScreenIdComponent("cat");
134 $ilHelp->setScreenId("administrate_user");
135 $ilHelp->setSubScreenId($ilCtrl->getCmd());
136 break;
137
138 case "ilcolumngui":
139 $this->checkPermission("read");
140 $this->prepareOutput();
141 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
142 $this->tpl->setVariable(
143 "LOCATION_CONTENT_STYLESHEET",
144 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
145 );
146 $this->renderObject();
147 break;
148
149 case 'ilpermissiongui':
150 $this->prepareOutput();
151 $this->tabs_gui->setTabActive('perm_settings');
152 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
153 $perm_gui = new ilPermissionGUI($this);
154 $ret = &$this->ctrl->forwardCommand($perm_gui);
155 break;
156
157 case 'ilinfoscreengui':
158 if ($this->info_screen_enabled) {
159 $this->prepareOutput();
160 $this->infoScreen();
161 }
162 break;
163
164 case 'ilcontainerlinklistgui':
165 include_once("Services/Container/classes/class.ilContainerLinkListGUI.php");
166 $link_list_gui = new ilContainerLinkListGUI();
167 $ret = &$this->ctrl->forwardCommand($link_list_gui);
168 break;
169
170 // container page editing
171 case "ilcontainerpagegui":
172 $this->prepareOutput(false);
173 $ret = $this->forwardToPageObject();
174 if ($ret != "") {
175 $this->tpl->setContent($ret);
176 }
177 $header_action = false;
178 break;
179
180 case 'ilobjectcopygui':
181 $this->prepareOutput();
182
183 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
184 $cp = new ilObjectCopyGUI($this);
185 $cp->setType('cat');
186 $this->ctrl->forwardCommand($cp);
187 break;
188
189 case "ilobjstylesheetgui":
190 $this->forwardToStyleSheet();
191 break;
192
193 case 'ilusertablegui':
194 include_once './Services/User/classes/class.ilUserTableGUI.php';
195 $u_table = new ilUserTableGUI($this, "listUsers");
196 $u_table->initFilter();
197 $this->ctrl->setReturn($this, 'listUsers');
198 $this->ctrl->forwardCommand($u_table);
199 break;
200
201 case "ilcommonactiondispatchergui":
202 $this->prepareOutput();
203 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
205 $this->ctrl->forwardCommand($gui);
206 break;
207
208 case 'ildidactictemplategui':
209 $this->ctrl->setReturn($this, 'edit');
210 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
211 $did = new ilDidacticTemplateGUI($this);
212 $this->ctrl->forwardCommand($did);
213 break;
214
215 case 'ilexportgui':
216 $this->prepareOutput();
217 $this->tabs_gui->setTabActive('export');
218 include_once './Services/Export/classes/class.ilExportGUI.php';
219 $exp = new ilExportGUI($this);
220 $exp->addFormat('xml');
221 $this->ctrl->forwardCommand($exp);
222 break;
223
224 case 'ilobjecttranslationgui':
225 $this->checkPermissionBool("write");
226 $this->prepareOutput();
227 //$this->tabs_gui->setTabActive('export');
228 $this->setEditTabs("settings_trans");
229 include_once("./Services/Object/classes/class.ilObjectTranslationGUI.php");
230 $transgui = new ilObjectTranslationGUI($this);
231 $this->ctrl->forwardCommand($transgui);
232 break;
233
234 case 'ilobjtaxonomygui':
235 $this->checkPermissionBool("write");
236 $this->prepareOutput();
237 $this->initTaxSubTabs();
238 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
239 $tax = new ilObjTaxonomyGUI();
240 $tax->setAssignedObject($this->object->getId());
241 $tax->setMultiple(true);
242 $tax->setListInfo($this->lng->txt("cntr_tax_list_info"));
243 $this->ctrl->forwardCommand($tax);
244 break;
245
246 case 'ilobjectmetadatagui':
247 $this->checkPermissionBool("write");
248 $this->prepareOutput();
249 $this->tabs_gui->activateTab('meta_data');
250 $this->ctrl->forwardCommand($this->getObjectMetadataGUI());
251 break;
252
253 case "ilcontainernewssettingsgui":
254 $this->prepareOutput();
255 $this->tabs_gui->setTabActive('settings');
256 $this->setEditTabs();
257 $this->tabs_gui->activateSubTab('obj_news_settings');
258 $news_set_gui = new ilContainerNewsSettingsGUI($this);
259 $news_set_gui->setHideByDate(true);
260 $this->ctrl->forwardCommand($news_set_gui);
261 break;
262
263 case 'ilcontainerfilteradmingui':
264 $this->checkPermissionBool("write");
265 $this->prepareOutput();
266 $this->setEditTabs($active_tab = "settings_filter");
267 $this->tabs_gui->activateTab('settings');
268 $this->ctrl->forwardCommand(new ilContainerFilterAdminGUI($this));
269 break;
270
271 default:
272 if ($cmd == "infoScreen") {
273 $this->checkPermission("visible");
274 } else {
275 $this->checkPermission("read");
276 }
277
278 // add entry to navigation history
279 if (!$this->getCreationMode() &&
280 $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
281 include_once("./Services/Link/classes/class.ilLink.php");
282 $ilNavigationHistory->addItem(
283 $_GET["ref_id"],
284 ilLink::_getLink($_GET["ref_id"], "cat"),
285 "cat"
286 );
287 }
288
289 $this->prepareOutput();
290 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
291 if (is_object($this->object)) {
292 $this->tpl->setVariable(
293 "LOCATION_CONTENT_STYLESHEET",
294 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
295 );
296 }
297
298 if (!$cmd) {
299 $cmd = "render";
300 }
301 $cmd .= "Object";
302 $this->tabs_gui->activateTab("view_content"); // see #19868
303 $this->$cmd();
304
305 break;
306 }
307
308 if ($header_action) {
309 $this->addHeaderAction();
310 }
311
312 return true;
313 }
314
315
319 protected function addHeaderAction()
320 {
322 parent::addHeaderAction();
323 }
324
325
332 public function getObjectMetadataGUI()
333 {
334 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
335 $md_gui = new ilObjectMetaDataGUI($this->object);
336 include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
338 $this->object->getId(),
340 false
341 )) {
342 $md_gui->enableTaxonomyDefinition(true);
343 $tax = $md_gui->getTaxonomyObjGUI();
344 $tax->setMultiple(true);
345 $tax->setListInfo($this->lng->txt("cntr_tax_list_info"));
346 $taxonomies = $this->getTaxonomiesForRefId();
347 if (sizeof($taxonomies)) {
348 $md_gui->setTaxonomySettings(function ($form) {
349 $tax = $this->getTaxonomiesForRefId();
350 $block = new ilCheckboxGroupInputGUI($this->lng->txt("cntr_taxonomy_show_sideblock"), "sblock");
351 $form->addItem($block);
352
353 $current = $this->getActiveBlocks();
354
355 foreach ($tax as $tax_id => $tax_item) {
356 $option = new ilCheckboxOption(
357 $tax_item["title"],
358 $tax_id,
360 );
361
362 if ($tax_item["source"] != $this->object->getRefId()) {
363 $loc = new ilLocatorGUI();
364 $loc->setTextOnly(true);
365 $loc->addRepositoryItems($tax_item["source"]);
366 $option->setInfo($loc->getHTML());
367 }
368
369 $block->addOption($option);
370
371 if (in_array($tax_id, $current)) {
372 $value[] = $tax_id;
373 }
374 }
375
376 $block->setValue($value);
377 }, function ($form) {
378 $taxonomies = $this->getTaxonomiesForRefId();
379 if (sizeof($taxonomies)) {
380 $sblock = $form->getInput("sblock");
381
383
385 $this->object->getId(),
386 $prefix . "%",
387 true
388 );
389
390 if (is_array($sblock)) {
391 foreach ($sblock as $tax_id) {
393 $this->object->getId(),
394 $prefix . $tax_id,
395 1
396 );
397 }
398 }
399 }
400 });
401 }
402 }
403 return $md_gui;
404 }
405
406
410 public function getTabs()
411 {
414 $ilHelp = $this->help;
415 $ilAccess = $this->access;
416
417 if ($this->ctrl->getCmd() == "editPageContent") {
418 return;
419 }
420 #$this->ctrl->setParameter($this,"ref_id",$this->ref_id);
421
422 $ilHelp->setScreenIdComponent("cat");
423
424 if ($rbacsystem->checkAccess('read', $this->ref_id)) {
425 $force_active = ($_GET["cmd"] == "" || $_GET["cmd"] == "render")
426 ? true
427 : false;
428 $this->tabs_gui->addTab(
429 "view_content",
430 $lng->txt("content"),
431 $this->ctrl->getLinkTarget($this, "")
432 );
433
434 //BEGIN ChangeEvent add info tab to category object
435 if ($this->info_screen_enabled) {
436 $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
437 || strtolower($_GET["cmdClass"]) == "ilnotegui")
438 ? true
439 : false;
440 $this->tabs_gui->addTarget(
441 "info_short",
442 $this->ctrl->getLinkTargetByClass(
443 array("ilobjcategorygui", "ilinfoscreengui"),
444 "showSummary"
445 ),
446 array("showSummary","", "infoScreen"),
447 "",
448 "",
449 $force_active
450 );
451 }
452 //END ChangeEvent add info tab to category object
453 }
454
455 if ($rbacsystem->checkAccess('write', $this->ref_id)) {
456 $force_active = ($_GET["cmd"] == "edit")
457 ? true
458 : false;
459 $this->tabs_gui->addTarget(
460 "settings",
461 $this->ctrl->getLinkTarget($this, "edit"),
462 "edit",
463 get_class($this),
464 "",
465 $force_active
466 );
467
468
469
470 // metadata / taxonomies
471 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
472 $mdgui = new ilObjectMetaDataGUI($this->object);
474 $this->object->getId(),
476 false
477 )) {
478 $mdgui->enableTaxonomyDefinition(true);
479 }
480 $mdtab = $mdgui->getTab();
481 if ($mdtab) {
482 $this->tabs_gui->addTab(
483 "meta_data",
484 $this->lng->txt("meta_data"),
485 $mdtab
486 );
487 }
488 }
489
490 include_once './Services/User/classes/class.ilUserAccountSettings.php';
491 if (
492 ilUserAccountSettings::getInstance()->isLocalUserAdministrationEnabled() and
493 $rbacsystem->checkAccess('cat_administrate_users', $this->ref_id)) {
494 $this->tabs_gui->addTarget(
495 "administrate_users",
496 $this->ctrl->getLinkTarget($this, "listUsers"),
497 "listUsers",
498 get_class($this)
499 );
500 }
501
502 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
503 $this->tabs_gui->addTarget(
504 'export',
505 $this->ctrl->getLinkTargetByClass('ilexportgui', ''),
506 'export',
507 'ilexportgui'
508 );
509 }
510
511 // parent tabs (all container: edit_permission, clipboard, trash
512 parent::getTabs();
513 }
514
518 public function renderObject()
519 {
520 $ilTabs = $this->tabs;
521
522 $ilTabs->activateTab("view_content");
523 $ret = parent::renderObject();
524
526 $this->object->getType(),
527 $this->object->getRefId(),
528 $this->object->getId(),
529 $this->user->getId()
530 );
531
532 return $ret;
533 }
534
535 public function viewObject()
536 {
537 if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
538 parent::viewObject();
539 return true;
540 }
541 return $this->renderObject();
542 }
543
544 protected function initCreationForms($a_new_type)
545 {
546 $forms = parent::initCreationForms($a_new_type);
547 //unset($forms[self::CFORM_IMPORT]);
548 return $forms;
549 }
550
551 protected function afterSave(ilObject $a_new_object)
552 {
554
555 // default: sort by title
556 include_once('Services/Container/classes/class.ilContainerSortingSettings.php');
557 $settings = new ilContainerSortingSettings($a_new_object->getId());
559 $settings->save();
560
561 // inherit parents content style, if not individual
562 $parent_ref_id = $tree->getParentId($a_new_object->getRefId());
563 $parent_id = ilObject::_lookupObjId($parent_ref_id);
564 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
565 $style_id = ilObjStyleSheet::lookupObjectStyle($parent_id);
566 if ($style_id > 0) {
567 if (ilObjStyleSheet::_lookupStandard($style_id)) {
568 ilObjStyleSheet::writeStyleUsage($a_new_object->getId(), $style_id);
569 }
570 }
571
572 // always send a message
573 ilUtil::sendSuccess($this->lng->txt("cat_added"), true);
574 $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
575 $this->redirectToRefId($a_new_object->getRefId(), "");
576 }
577
583 public function infoScreenObject()
584 {
585 $this->ctrl->setCmd("showSummary");
586 $this->ctrl->setCmdClass("ilinfoscreengui");
587 $this->infoScreen();
588 }
589
593 public function infoScreen()
594 {
595 $ilAccess = $this->access;
596 $ilCtrl = $this->ctrl;
598
599 if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
600 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
601 }
602
603 if (!$this->info_screen_enabled) {
604 return;
605 }
606
607 // #10986
608 $this->tabs_gui->setTabActive('info_short');
609
610 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
611 $info = new ilInfoScreenGUI($this);
612
613 $info->enablePrivateNotes();
614
615 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
616 $info->enableNews();
617 }
618
619 // no news editing for files, just notifications
620 $info->enableNewsEditing(false);
621 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
622 $news_set = new ilSetting("news");
623 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
624
625 if ($enable_internal_rss) {
626 $info->setBlockProperty("news", "settings", true);
627 $info->setBlockProperty("news", "public_notifications_option", true);
628 }
629 }
630
631 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
632 $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'cat', $this->object->getId());
633 $record_gui->setInfoObject($info);
634 $record_gui->parse();
635
636
637 // standard meta data
638 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
639
640 // forward the command
641 if ($ilCtrl->getNextClass() == "ilinfoscreengui") {
642 $ilCtrl->forwardCommand($info);
643 } else {
644 return $ilCtrl->getHTML($info);
645 }
646 }
647
653 protected function editInfoObject()
654 {
655 $this->checkPermission("write");
656 $this->setEditTabs();
657 $this->tabs_gui->activateTab('settings');
658 $this->tabs_gui->setSubTabActive('edit_cat_settings');
659
660 $this->initExtendedSettings();
661 $this->tpl->setContent($this->form->getHTML());
662 }
663
669 protected function updateInfoObject()
670 {
671 $this->checkPermission("write");
672
673 // init form
674 $this->initExtendedSettings();
675
676 // still needed for date conversion and so on
677 $this->form->checkInput();
678
679 if ($this->record_gui->importEditFormPostValues()) {
680 $this->record_gui->writeEditForm();
681
682 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
683 $this->ctrl->redirect($this, "editInfo");
684 }
685
686 $this->editInfoObject();
687 }
688
689
695 protected function initExtendedSettings()
696 {
697 if (is_object($this->form)) {
698 return true;
699 }
700
701 include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
702 $this->form = new ilPropertyFormGUI();
703 $this->form->setFormAction($this->ctrl->getFormAction($this));
704 $this->form->setTitle($this->lng->txt('ext_cat_settings'));
705 $this->form->addCommandButton('updateInfo', $this->lng->txt('save'));
706 $this->form->addCommandButton('editInfo', $this->lng->txt('cancel'));
707
708 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
709 $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'cat', $this->object->getId());
710 $this->record_gui->setPropertyForm($this->form);
711 $this->record_gui->parse();
712
713 return true;
714 }
715
716 protected function setEditTabs($active_tab = "settings_misc")
717 {
719 $ilTabs = $this->tabs;
720
721 $this->tabs_gui->addSubTab(
722 "settings_misc",
723 $this->lng->txt("settings"),
724 $this->ctrl->getLinkTarget($this, "edit")
725 );
726
727 $this->tabs_gui->addSubTab(
728 "settings_trans",
729 $this->lng->txt("obj_multilinguality"),
730 $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "")
731 );
732
733 //news tab
735 $this->object->getId(),
737 true
738 );
739
740 if ($news_active) {
741 $this->tabs_gui->addSubTab(
742 'obj_news_settings',
743 $this->lng->txt("cont_news_settings"),
744 $this->ctrl->getLinkTargetByClass('ilcontainernewssettingsgui')
745 );
746 }
747
748 $this->tabs_gui->addSubTab(
749 "settings_filter",
750 $this->lng->txt("cont_filter"),
751 $this->ctrl->getLinkTargetByClass("ilcontainerfilteradmingui", "")
752 );
753
754 $this->tabs_gui->activateTab("settings");
755 $this->tabs_gui->activateSubTab($active_tab);
756 }
757
758 public function initEditForm()
759 {
760 $obj_service = $this->getObjectService();
761
762 $this->lng->loadLanguageModule($this->object->getType());
763 $this->setEditTabs();
764
765 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
766 $form = new ilPropertyFormGUI();
767 $form->setFormAction($this->ctrl->getFormAction($this));
768 $form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
769
770 // title/description
771 $this->initFormTitleDescription($form);
772
773 // Show didactic template type
774 $this->initDidacticTemplate($form);
775
776 // presentation
777 $pres = new ilFormSectionHeaderGUI();
778 $pres->setTitle($this->lng->txt('obj_presentation'));
779 $form->addItem($pres);
780
781 // title and icon visibility
782 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTitleIconVisibility();
783
784 // top actions visibility
785 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTopActionsVisibility();
786
787 // custom icon
788 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addIcon();
789
790 // tile image
791 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
792
793 // list presentation
794 $form = $this->initListPresentationForm($form);
795
796 // sorting
797 $form = $this->initSortingForm(
798 $form,
799 array(
803 )
804 );
805
806 // block limit
807 $bl = new ilNumberInputGUI($this->lng->txt("cont_block_limit"), "block_limit");
808 $bl->setInfo($this->lng->txt("cont_block_limit_info"));
809 $bl->setValue(ilContainer::_lookupContainerSetting($this->object->getId(), "block_limit"));
810 $form->addItem($bl);
811
812 // icon settings
813
814 // Edit ecs export settings
815 include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
816 $ecs = new ilECSCategorySettings($this->object);
817 $ecs->addSettingsToForm($form, 'cat');
818
819 // services
820 $sh = new ilFormSectionHeaderGUI();
821 $sh->setTitle($this->lng->txt('obj_features'));
822 $form->addItem($sh);
823
824 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
826 $this->object->getId(),
827 $form,
828 array(
835 )
836 );
837
838 $form->addCommandButton("update", $this->lng->txt("save"));
839
840 return $form;
841 }
842
843 public function getEditFormValues()
844 {
845 // values are set in initEditForm()
846 }
847
853 public function updateObject()
854 {
857 $obj_service = $this->getObjectService();
858
859 if (!$this->checkPermissionBool("write")) {
860 $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
861 } else {
862 $form = $this->initEditForm();
863 if ($form->checkInput()) {
864 $title = $form->getInput("title");
865 $desc = $form->getInput("desc");
866
867 $this->object->setTitle($title);
868 $this->object->setDescription($desc);
869 $this->object->update();
870
871 $this->saveSortingSettings($form);
872
873 // title icon visibility
874 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTitleIconVisibility();
875
876 // top actions visibility
877 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTopActionsVisibility();
878
879 // custom icon
880 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();
881
882 // tile image
883 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
884
885 // list presentation
886 $this->saveListPresentation($form);
887
888 // BEGIN ChangeEvent: Record update
889 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
890 ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
891 ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
892 // END ChangeEvent: Record update
893
894 // services
895 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
897 $this->object->getId(),
898 $form,
899 array(
906 )
907 );
908
909 // block limit
910 if ((int) $form->getInput("block_limit") > 0) {
911 ilContainer::_writeContainerSetting($this->object->getId(), "block_limit", (int) $form->getInput("block_limit"));
912 } else {
913 ilContainer::_deleteContainerSettings($this->object->getId(), "block_limit");
914 }
915 // Update ecs export settings
916 include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
917 $ecs = new ilECSCategorySettings($this->object);
918 if ($ecs->handleSettingsUpdate()) {
919 return $this->afterUpdate();
920 }
921 }
922
923 // display form to correct errors
924 $this->setEditTabs();
925 $form->setValuesByPost();
926 $this->tpl->setContent($form->getHTML());
927 }
928 }
929
934 {
935 ilObjCategoryGUI::_importCategoriesForm($this->ref_id, $this->tpl);
936 }
937
941 public static function _importCategoriesForm($a_ref_id, &$a_tpl)
942 {
943 global $DIC;
944
945 $lng = $DIC->language();
946 $rbacreview = $DIC->rbac()->review();
947 $ilCtrl = $DIC->ctrl();
948
949 $a_tpl->addBlockfile(
950 "ADM_CONTENT",
951 "adm_content",
952 "tpl.cat_import_form.html",
953 "Modules/Category"
954 );
955
956 $a_tpl->setVariable("FORMACTION", $ilCtrl->getFormActionByClass('ilObjCategoryGUI'));
957
958 $a_tpl->setVariable("TXT_IMPORT_CATEGORIES", $lng->txt("import_categories"));
959 $a_tpl->setVariable("TXT_HIERARCHY_OPTION", $lng->txt("import_cat_localrol"));
960 $a_tpl->setVariable("TXT_IMPORT_FILE", $lng->txt("import_file"));
961 $a_tpl->setVariable("TXT_IMPORT_TABLE", $lng->txt("import_cat_table"));
962
963 $a_tpl->setVariable("BTN_IMPORT", $lng->txt("import"));
964 $a_tpl->setVariable("BTN_CANCEL", $lng->txt("cancel"));
965
966 // NEED TO FILL ADOPT_PERMISSIONS HTML FORM....
967 $parent_role_ids = $rbacreview->getParentRoleIds($a_ref_id, true);
968
969 // sort output for correct color changing
970 ksort($parent_role_ids);
971
972 foreach ($parent_role_ids as $key => $par) {
973 if ($par["obj_id"] != SYSTEM_ROLE_ID) {
974 $check = ilUtil::formCheckbox(0, "adopt[]", $par["obj_id"], 1);
975 $output["adopt"][$key]["css_row_adopt"] = ilUtil::switchColor($key, "tblrow1", "tblrow2");
976 $output["adopt"][$key]["check_adopt"] = $check;
977 $output["adopt"][$key]["role_id"] = $par["obj_id"];
978 $output["adopt"][$key]["type"] = ($par["type"] == 'role' ? 'Role' : 'Template');
979 $output["adopt"][$key]["role_name"] = $par["title"];
980 }
981 }
982
983 //var_dump($output);
984
985 // BEGIN ADOPT PERMISSIONS
986 foreach ($output["adopt"] as $key => $value) {
987 $a_tpl->setCurrentBlock("ADOPT_PERM_ROW");
988 $a_tpl->setVariable("CSS_ROW_ADOPT", $value["css_row_adopt"]);
989 $a_tpl->setVariable("CHECK_ADOPT", $value["check_adopt"]);
990 $a_tpl->setVariable("LABEL_ID", $value["role_id"]);
991 $a_tpl->setVariable("TYPE", $value["type"]);
992 $a_tpl->setVariable("ROLE_NAME", $value["role_name"]);
993 $a_tpl->parseCurrentBlock();
994 }
995 }
996
997
1003 public function importCancelledObject()
1004 {
1005 $this->ctrl->redirect($this);
1006 }
1007
1011 public static function _getImportDir()
1012 {
1013 return ilUtil::getDataDir() . "/cat_import";
1014 }
1015
1019 public function importCategoriesObject()
1020 {
1022 // call to importCategories with $withrol = 0
1024 }
1025
1030 {
1031
1032 //echo "entra aqui";
1033 // call to importCategories with $withrol = 1
1035 }
1036
1041 public static function _importCategories($a_ref_id, $withrol_tmp)
1042 {
1043 global $DIC;
1044
1045 $lng = $DIC->language();
1046 $ilCtrl = $DIC->ctrl();
1047
1048 require_once("./Modules/Category/classes/class.ilCategoryImportParser.php");
1049
1050 $import_dir = ilObjCategoryGUI::_getImportDir();
1051
1052 // create user import directory if necessary
1053 if (!@is_dir($import_dir)) {
1054 ilUtil::createDirectory($import_dir);
1055 }
1056
1057 // move uploaded file to user import directory
1058
1059 $file_name = $_FILES["importFile"]["name"];
1060
1061 // added to prevent empty file names
1062 if (!strcmp($file_name, "")) {
1063 ilUtil::sendFailure($lng->txt("no_import_file_found"), true);
1064 $ilCtrl->redirectByClass('ilObjCategoryGUI');
1065 }
1066
1067 $parts = pathinfo($file_name);
1068 $full_path = $import_dir . "/" . $file_name;
1069 ilUtil::moveUploadedFile($_FILES["importFile"]["tmp_name"], $file_name, $full_path);
1070
1071 // unzip file
1072 ilUtil::unzip($full_path);
1073
1074 $subdir = basename($parts["basename"], "." . $parts["extension"]);
1075 $xml_file = $import_dir . "/" . $subdir . "/" . $subdir . ".xml";
1076 // CategoryImportParser
1077 //var_dump($_POST);
1078 $importParser = new ilCategoryImportParser($xml_file, $a_ref_id, $withrol_tmp);
1079 $importParser->startParsing();
1080
1081 ilUtil::sendSuccess($lng->txt("categories_imported"), true);
1082 $ilCtrl->redirectByClass('ilObjCategoryGUI');
1083 }
1084
1089 protected function resetFilterObject()
1090 {
1091 include_once("./Services/User/classes/class.ilUserTableGUI.php");
1092 $utab = new ilUserTableGUI($this, "listUsers", ilUserTableGUI::MODE_LOCAL_USER);
1093 $utab->resetOffset();
1094 $utab->resetFilter();
1095
1096 // from "old" implementation
1097 $this->listUsersObject();
1098 }
1099
1104 protected function applyFilterObject()
1105 {
1106 $ilTabs = $this->tabs;
1107
1108 include_once("./Services/User/classes/class.ilUserTableGUI.php");
1109 $utab = new ilUserTableGUI($this, "listUsers", ilUserTableGUI::MODE_LOCAL_USER);
1110 $utab->resetOffset();
1111 $utab->writeFilterToSession();
1112 $this->listUsersObject();
1113 }
1114
1115 // METHODS for local user administration
1116 public function listUsersObject($show_delete = false)
1117 {
1120 $ilToolbar = $this->toolbar;
1121
1122 include_once './Services/User/classes/class.ilLocalUser.php';
1123 include_once './Services/User/classes/class.ilObjUserGUI.php';
1124
1127
1128 if (!$rbacsystem->checkAccess("cat_administrate_users", $this->object->getRefId())) {
1129 $ilErr->raiseError($this->lng->txt("msg_no_perm_admin_users"), $ilErr->MESSAGE);
1130 }
1131 $this->tabs_gui->setTabActive('administrate_users');
1132
1133
1134
1135 $this->tpl->addBlockfile(
1136 'ADM_CONTENT',
1137 'adm_content',
1138 'tpl.cat_admin_users.html',
1139 "Modules/Category"
1140 );
1141
1142 if (count($rbacreview->getGlobalAssignableRoles()) or in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1143 $ilToolbar->addButton(
1144 $this->lng->txt('add_user'),
1145 $this->ctrl->getLinkTargetByClass('ilobjusergui', 'create')
1146 );
1147
1148 $ilToolbar->addButton(
1149 $this->lng->txt('import_users'),
1150 $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'importUserForm')
1151 );
1152 } else {
1153 ilUtil::sendInfo($this->lng->txt('no_roles_user_can_be_assigned_to'));
1154 }
1155
1156 if ($show_delete) {
1157 $this->tpl->setCurrentBlock("confirm_delete");
1158 $this->tpl->setVariable("CONFIRM_FORMACTION", $this->ctrl->getFormAction($this));
1159 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt('cancel'));
1160 $this->tpl->setVariable("CONFIRM_CMD", 'performDeleteUsers');
1161 $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt('delete'));
1162 $this->tpl->parseCurrentBlock();
1163 }
1164
1165 $this->lng->loadLanguageModule('user');
1166
1167 include_once("./Services/User/classes/class.ilUserTableGUI.php");
1168 $utab = new ilUserTableGUI($this, 'listUsers', ilUserTableGUI::MODE_LOCAL_USER);
1169 $this->tpl->setVariable('USERS_TABLE', $utab->getHTML());
1170
1171 return true;
1172 }
1173
1177 protected function addUserAutoCompleteObject()
1178 {
1179 include_once './Services/User/classes/class.ilUserAutoComplete.php';
1180 $auto = new ilUserAutoComplete();
1181 $auto->setSearchFields(array('login','firstname','lastname','email'));
1182 $auto->enableFieldSearchableCheck(true);
1183 $auto->isMoreLinkAvailable(true);
1184
1185 if (($_REQUEST['fetchall'])) {
1186 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
1187 }
1188
1189 echo $auto->getList($_REQUEST['term']);
1190 exit();
1191 }
1192
1193
1195 {
1196 include_once './Services/User/classes/class.ilLocalUser.php';
1197 $this->checkPermission("cat_administrate_users");
1198
1199 foreach ($_POST['user_ids'] as $user_id) {
1200 if (!in_array($user_id, ilLocalUser::_getAllUserIds($this->object->getRefId()))) {
1201 die('user id not valid');
1202 }
1203 if (!$tmp_obj = &ilObjectFactory::getInstanceByObjId($user_id, false)) {
1204 continue;
1205 }
1206 $tmp_obj->delete();
1207 }
1208 ilUtil::sendSuccess($this->lng->txt('deleted_users'));
1209 $this->listUsersObject();
1210
1211 return true;
1212 }
1213
1214 public function deleteUsersObject()
1215 {
1216 $this->checkPermission("cat_administrate_users");
1217 if (!count($_POST['id'])) {
1218 ilUtil::sendFailure($this->lng->txt('no_users_selected'));
1219 $this->listUsersObject();
1220
1221 return true;
1222 }
1223
1224 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1225 $confirm = new ilConfirmationGUI();
1226 $confirm->setFormAction($this->ctrl->getFormAction($this));
1227 $confirm->setHeaderText($this->lng->txt('sure_delete_selected_users'));
1228 $confirm->setConfirm($this->lng->txt('delete'), 'performDeleteUsers');
1229 $confirm->setCancel($this->lng->txt('cancel'), 'listUsers');
1230
1231 foreach ($_POST['id'] as $user) {
1233
1234 $confirm->addItem(
1235 'user_ids[]',
1236 $user,
1237 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']'
1238 );
1239 }
1240 $this->tpl->setContent($confirm->getHTML());
1241 }
1242
1243 public function assignRolesObject()
1244 {
1246 $ilTabs = $this->tabs;
1247
1248 $this->checkPermission("cat_administrate_users");
1249
1250 include_once './Services/User/classes/class.ilLocalUser.php';
1251
1252 if (!isset($_GET['obj_id'])) {
1253 ilUtil::sendFailure('no_user_selected');
1254 $this->listUsersObject();
1255
1256 return true;
1257 }
1258
1259 $ilTabs->clearTargets();
1260 $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
1261 $ilHelp = $this->help;
1262 $ilHelp->setScreenIdComponent("cat");
1263 $ilHelp->setScreenId("administrate_user");
1264 $ilHelp->setSubScreenId("assign_roles");
1265
1266
1267 $roles = $this->__getAssignableRoles();
1268
1269 if (!count($roles)) {
1270 #ilUtil::sendInfo($this->lng->txt('no_roles_user_can_be_assigned_to'));
1271 #$this->listUsersObject();
1272
1273 #return true;
1274 }
1275
1276 $ass_roles = $rbacreview->assignedRoles($_GET['obj_id']);
1277
1278 $counter = 0;
1279 $f_result = array();
1280
1281 foreach ($roles as $role) {
1282 $role_obj = &ilObjectFactory::getInstanceByObjId($role['obj_id']);
1283
1284 $disabled = false;
1285 $f_result[$counter]['checkbox'] = ilUtil::formCheckbox(
1286 in_array($role['obj_id'], $ass_roles) ? 1 : 0,
1287 'role_ids[]',
1288 $role['obj_id'],
1289 $disabled
1290 );
1291 $f_result[$counter]['title'] = $role_obj->getTitle() ? $role_obj->getTitle() : "";
1292 $f_result[$counter]['desc'] = $role_obj->getDescription() ? $role_obj->getDescription() : "";
1293 $f_result[$counter]['type'] = $role['role_type'] == 'global' ?
1294 $this->lng->txt('global') :
1295 $this->lng->txt('local');
1296
1297 unset($role_obj);
1298 ++$counter;
1299 }
1300
1301 include_once('./Modules/Category/classes/class.ilCategoryAssignRoleTableGUI.php');
1302 $table = new ilCategoryAssignRoleTableGUI($this, "assignRoles");
1303 $tmp_obj = &ilObjectFactory::getInstanceByObjId($_GET['obj_id']);
1304 $title = $this->lng->txt('role_assignment') . ' (' . $tmp_obj->getFullname() . ')';
1305 $table->setTitle($title, "icon_role.svg", $this->lng->txt("role_assignment"));
1306 $table->setData($f_result);
1307 $this->tpl->setContent($table->getHTML());
1308 }
1309
1310 public function assignSaveObject()
1311 {
1314 $this->checkPermission("cat_administrate_users");
1315
1316 include_once './Services/User/classes/class.ilLocalUser.php';
1317 // check hack
1318 if (!isset($_GET['obj_id']) or !in_array($_REQUEST['obj_id'], ilLocalUser::_getAllUserIds())) {
1319 ilUtil::sendFailure('no_user_selected');
1320 $this->listUsersObject();
1321
1322 return true;
1323 }
1324 $roles = $this->__getAssignableRoles();
1325
1326 // check minimum one global role
1327 if (!$this->__checkGlobalRoles($_POST['role_ids'])) {
1328 ilUtil::sendFailure($this->lng->txt('no_global_role_left'));
1329 $this->assignRolesObject();
1330
1331 return false;
1332 }
1333
1334 $new_role_ids = $_POST['role_ids'] ? $_POST['role_ids'] : array();
1335 $assigned_roles = $rbacreview->assignedRoles((int) $_REQUEST['obj_id']);
1336 foreach ($roles as $role) {
1337 if (in_array($role['obj_id'], $new_role_ids) and !in_array($role['obj_id'], $assigned_roles)) {
1338 $rbacadmin->assignUser($role['obj_id'], (int) $_REQUEST['obj_id']);
1339 }
1340 if (in_array($role['obj_id'], $assigned_roles) and !in_array($role['obj_id'], $new_role_ids)) {
1341 $rbacadmin->deassignUser($role['obj_id'], (int) $_REQUEST['obj_id']);
1342 }
1343 }
1344 ilUtil::sendSuccess($this->lng->txt('role_assignment_updated'));
1345 $this->assignRolesObject();
1346
1347 return true;
1348 }
1349
1350 // PRIVATE
1351 public function __getAssignableRoles()
1352 {
1355
1356 // check local user
1357 $tmp_obj = &ilObjectFactory::getInstanceByObjId($_REQUEST['obj_id']);
1358 // Admin => all roles
1359 if (in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1360 $global_roles = $rbacreview->getGlobalRolesArray();
1361 } elseif ($tmp_obj->getTimeLimitOwner() == $this->object->getRefId()) {
1362 $global_roles = $rbacreview->getGlobalAssignableRoles();
1363 } else {
1364 $global_roles = array();
1365 }
1366 return $roles = array_merge(
1367 $global_roles,
1368 $rbacreview->getAssignableChildRoles($this->object->getRefId())
1369 );
1370 }
1371
1372 public function __checkGlobalRoles($new_assigned)
1373 {
1376
1377 $this->checkPermission("cat_administrate_users");
1378
1379 // return true if it's not a local user
1380 $tmp_obj = &ilObjectFactory::getInstanceByObjId($_REQUEST['obj_id']);
1381 if ($tmp_obj->getTimeLimitOwner() != $this->object->getRefId() and
1382 !in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1383 return true;
1384 }
1385
1386 // new assignment by form
1387 $new_assigned = $new_assigned ? $new_assigned : array();
1388 $assigned = $rbacreview->assignedRoles((int) $_GET['obj_id']);
1389
1390 // all assignable globals
1391 if (!in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1392 $ga = $rbacreview->getGlobalAssignableRoles();
1393 } else {
1394 $ga = $rbacreview->getGlobalRolesArray();
1395 }
1396 $global_assignable = array();
1397 foreach ($ga as $role) {
1398 $global_assignable[] = $role['obj_id'];
1399 }
1400
1401 $new_visible_assigned_roles = array_intersect($new_assigned, $global_assignable);
1402 $all_assigned_roles = array_intersect($assigned, $rbacreview->getGlobalRoles());
1403 $main_assigned_roles = array_diff($all_assigned_roles, $global_assignable);
1404
1405 if (!count($new_visible_assigned_roles) and !count($main_assigned_roles)) {
1406 return false;
1407 }
1408 return true;
1409 }
1410
1411 public static function _goto($a_target)
1412 {
1413 global $DIC;
1414
1415 $ilAccess = $DIC->access();
1416 $ilErr = $DIC["ilErr"];
1417 $lng = $DIC->language();
1418
1419 if ($ilAccess->checkAccess("read", "", $a_target)) {
1421 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1422 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1423 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1424 ilUtil::sendFailure(sprintf(
1425 $lng->txt("msg_no_perm_read_item"),
1427 ), true);
1429 }
1430
1431 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1432 }
1433
1434 //
1435 // taxonomy
1436 //
1437
1438 protected function initTaxSubTabs($a_active = "tax_list")
1439 {
1440 $this->tabs_gui->setTabActive("obj_tool_setting_taxonomies");
1441 $this->tabs_gui->addSubTab(
1442 "tax_settings",
1443 $this->lng->txt("cntr_taxonomy_sideblock_settings"),
1444 $this->ctrl->getLinkTarget($this, "editTaxonomySettings")
1445 );
1446 $this->tabs_gui->addSubTab(
1447 "tax_list",
1448 $this->lng->txt("cntr_taxonomy_definitions"),
1449 $this->ctrl->getLinkTargetByClass("ilobjtaxonomygui", "")
1450 );
1451 $this->tabs_gui->activateSubTab($a_active);
1452 }
1453
1454 protected function getTaxonomiesForRefId()
1455 {
1457
1458 include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
1459 include_once "Services/Taxonomy/classes/class.ilObjTaxonomy.php";
1460
1461 // see ilTaxMDGUI::getSelectableTaxonomies()
1462
1463 $res = array();
1464 foreach ($tree->getPathFull($this->object->getRefId()) as $node) {
1465 //if ($node["ref_id"] != $this->object->getRefId())
1466 {
1467 // find all defined taxes for parent node, activation is not relevant
1468 $node_taxes = ilObjTaxonomy::getUsageOfObject($node["obj_id"], true);
1469 if (sizeof($node_taxes)) {
1470 foreach ($node_taxes as $node_tax) {
1471 $res[$node_tax["tax_id"]] = array(
1472 "title" => $node_tax["title"]
1473 , "source" => $node["child"]
1474 );
1475 }
1476 }
1477 }
1478 }
1479
1480 asort($res);
1481 return $res;
1482 }
1483
1484
1485 protected function getActiveBlocks()
1486 {
1487 $res = array();
1488
1490
1491 foreach (ilContainer::_getContainerSettings($this->object->getId()) as $keyword => $value) {
1492 if (substr($keyword, 0, strlen($prefix)) == $prefix && (bool) $value) {
1493 $res[] = substr($keyword, strlen($prefix));
1494 }
1495 }
1496
1497 return $res;
1498 }
1499} // END class.ilObjCategoryGUI
user()
Definition: user.php:4
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
TableGUI class for role assignments.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
This class represents a property in a property form.
This class represents an option in a checkbox group.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
Filter administration for containers.
Class ilContainerGUI.
afterUpdate()
Post (successful) object update hook.
& forwardToPageObject()
forward command to page object
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
prepareOutput($a_show_subobjects=true)
prepare output
saveListPresentation(ilPropertyFormGUI $form)
Save list presentation setting.
forwardToStyleSheet()
Forward to style object.
initListPresentationForm(ilPropertyFormGUI $form)
Add list presentation settings to form.
saveSortingSettings(ilPropertyFormGUI $form)
Save sorting settings.
Class ilContainerLinkListGUI.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static _deleteContainerSettings($a_id, $a_keyword=null, $a_keyword_like=false)
static _getContainerSettings($a_id)
static _writeContainerSetting($a_id, $a_keyword, $a_value)
GUI class for didactic template settings inside repository objects.
Class ilECSCategorySettings.
Export User Interface Class.
This class represents a section header in a property form.
Class ilInfoScreenGUI.
static _getAllUserIds($a_filter=0)
locator handling class
This class represents a number property in a property form.
Class ilObjCategoryGUI.
initExtendedSettings()
build property form for extended category settings
initEditForm()
Init object edit form.
updateObject()
updates object entry in object_data
importCategoriesWithRolObject()
import categories with local rol
importCategoriesFormObject()
display form for category import
addUserAutoCompleteObject()
Show auto complete results.
getObjectMetadataGUI()
Get object metadata gui.
getEditFormValues()
Get values for edit form.
initTaxSubTabs($a_active="tax_list")
static _importCategories($a_ref_id, $withrol_tmp)
import categories (static, also called by RootFolderGUI)
editInfoObject()
Edit extended category settings.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
infoScreen()
show information screen
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
listUsersObject($show_delete=false)
applyFilterObject()
Apply filter.
initCreationForms($a_new_type)
Init creation froms.
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"
executeCommand()
execute command note: this method is overwritten in all container objects
importCategoriesObject()
import categories
static _getImportDir()
get user import directory name
__checkGlobalRoles($new_assigned)
static _importCategoriesForm($a_ref_id, &$a_tpl)
display form for category import (static, also called by RootFolderGUI)
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
setEditTabs($active_tab="settings_misc")
renderObject()
Render category.
resetFilterObject()
Reset filter (note: this function existed before data table filter has been introduced.
updateInfoObject()
Update info (extended meta data)
importCancelledObject()
import cancelled
static _lookupStandard($a_id)
Lookup standard flag.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
Taxonomy GUI class.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
Class ilObjUserFolderGUI.
Class ilObjUserGUI.
static _lookupName($a_user_id)
lookup user name
GUI class for the workflow of copying objects.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
getObjectService()
Get object service.
redirectToRefId($a_ref_id, $a_cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
Class ilObjectMetaDataGUI.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
GUI class for object translation handling.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
getRefId()
get reference id @access public
getId()
get object id @access public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static initPreview()
Initializes the preview and loads the needed javascripts and styles.
This class represents a property form user interface.
ILIAS Setting Class.
static getInstance()
Singelton get instance.
Auto completion class for user lists.
TableGUI class for user administration.
static getDataDir()
get data directory (outside webspace)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static createDirectory($a_dir, $a_mod=0755)
create directory
const SYSTEM_ROLE_ID
Definition: constants.php:27
const ROOT_FOLDER_ID
Definition: constants.php:30
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
$ilUser
Definition: imgupload.php:18
exit
Definition: login.php:29
if($format !==null) $name
Definition: metadata.php:230
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6
global $ilSetting
Definition: privfeed.php:17
foreach($_POST as $key=> $value) $res
settings()
Definition: settings.php:2