ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
22{
26 protected $nav_history;
27
31 protected $help;
32
33 public $ctrl;
34
35 const CONTAINER_SETTING_TAXBLOCK = "tax_sblock_";
36
41 public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
42 {
43 global $DIC;
44
45 $this->rbacsystem = $DIC->rbac()->system();
46 $this->nav_history = $DIC["ilNavigationHistory"];
47 $this->access = $DIC->access();
48 $this->ctrl = $DIC->ctrl();
49 $this->tabs = $DIC->tabs();
50 $this->help = $DIC["ilHelp"];
51 $this->lng = $DIC->language();
52 $this->user = $DIC->user();
53 $this->tree = $DIC->repositoryTree();
54 $this->error = $DIC["ilErr"];
55 $this->settings = $DIC->settings();
56 $this->tpl = $DIC["tpl"];
57 $this->toolbar = $DIC->toolbar();
58 $this->rbacreview = $DIC->rbac()->review();
59 $this->rbacadmin = $DIC->rbac()->admin();
60 //global $ilCtrl;
61
62 // CONTROL OPTIONS
63 //$this->ctrl =& $ilCtrl;
64 //$this->ctrl->saveParameter($this,array("ref_id","cmdClass"));
65 $GLOBALS['lng']->loadLanguageModule('cat');
66 $GLOBALS['lng']->loadLanguageModule('obj');
67
68 $this->type = "cat";
69 parent::__construct($a_data, (int) $a_id, $a_call_by_reference, false);
70
71 if (is_object($this->object)) {
72 include_once("./Services/Container/classes/class.ilContainer.php");
73 include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
74 $this->info_screen_enabled = ilContainer::_lookupContainerSetting(
75 $this->object->getId(),
77 true
78 );
79 }
80 }
81
82 public function executeCommand()
83 {
85 $ilNavigationHistory = $this->nav_history;
86 $ilAccess = $this->access;
88 $ilTabs = $this->tabs;
89
90 $next_class = $this->ctrl->getNextClass($this);
91 $cmd = $this->ctrl->getCmd();
92
93 switch ($next_class) {
94 case "ilobjusergui":
95 include_once('./Services/User/classes/class.ilObjUserGUI.php');
96
97 $this->tabs_gui->setTabActive('administrate_users');
98 if (!$_GET['obj_id']) {
99 $this->gui_obj = new ilObjUserGUI("", $_GET['ref_id'], true, false);
100 $this->gui_obj->setCreationMode($this->creation_mode);
101 $ret = &$this->ctrl->forwardCommand($this->gui_obj);
102 } else {
103 $this->gui_obj = new ilObjUserGUI("", $_GET['obj_id'], false, false);
104 $this->gui_obj->setCreationMode($this->creation_mode);
105 $ret = &$this->ctrl->forwardCommand($this->gui_obj);
106 }
107
108 $ilTabs->clearTargets();
109 $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
110 $ilHelp = $this->help;
111 $ilHelp->setScreenIdComponent("cat");
112 $ilHelp->setScreenId("administrate_user");
113 $ilHelp->setSubScreenId($ilCtrl->getCmd());
114 break;
115
116 case "ilobjuserfoldergui":
117 include_once('./Services/User/classes/class.ilObjUserFolderGUI.php');
118
119 $this->gui_obj = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
120 $this->gui_obj->setUserOwnerId((int) $_GET['ref_id']);
121 $this->gui_obj->setCreationMode($this->creation_mode);
122 $ret = &$this->ctrl->forwardCommand($this->gui_obj);
123
124 $ilTabs->clearTargets();
125 $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
126 $ilHelp = $this->help;
127 $ilHelp->setScreenIdComponent("cat");
128 $ilHelp->setScreenId("administrate_user");
129 $ilHelp->setSubScreenId($ilCtrl->getCmd());
130 break;
131
132 case "ilcolumngui":
133 $this->checkPermission("read");
134 $this->prepareOutput();
135 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
136 $this->tpl->setVariable(
137 "LOCATION_CONTENT_STYLESHEET",
138 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
139 );
140 $this->renderObject();
141 break;
142
143 case 'ilpermissiongui':
144 $this->prepareOutput();
145 $this->tabs_gui->setTabActive('perm_settings');
146 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
147 $perm_gui = new ilPermissionGUI($this);
148 $ret = &$this->ctrl->forwardCommand($perm_gui);
149 break;
150
151 case 'ilinfoscreengui':
152 if ($this->info_screen_enabled) {
153 $this->prepareOutput();
154 $this->infoScreen();
155 }
156 break;
157
158 case 'ilcontainerlinklistgui':
159 include_once("Services/Container/classes/class.ilContainerLinkListGUI.php");
160 $link_list_gui = new ilContainerLinkListGUI();
161 $ret = &$this->ctrl->forwardCommand($link_list_gui);
162 break;
163
164 // container page editing
165 case "ilcontainerpagegui":
166 $this->prepareOutput(false);
167 $ret = $this->forwardToPageObject();
168 if ($ret != "") {
169 $this->tpl->setContent($ret);
170 }
171 break;
172
173 case 'ilobjectcopygui':
174 $this->prepareOutput();
175
176 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
177 $cp = new ilObjectCopyGUI($this);
178 $cp->setType('cat');
179 $this->ctrl->forwardCommand($cp);
180 break;
181
182 case "ilobjstylesheetgui":
183 $this->forwardToStyleSheet();
184 break;
185
186 case 'ilusertablegui':
187 include_once './Services/User/classes/class.ilUserTableGUI.php';
188 $u_table = new ilUserTableGUI($this, "listUsers");
189 $u_table->initFilter();
190 $this->ctrl->setReturn($this, 'listUsers');
191 $this->ctrl->forwardCommand($u_table);
192 break;
193
194 case "ilcommonactiondispatchergui":
195 $this->prepareOutput();
196 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
198 $this->ctrl->forwardCommand($gui);
199 break;
200
201 case 'ildidactictemplategui':
202 $this->ctrl->setReturn($this, 'edit');
203 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
204 $did = new ilDidacticTemplateGUI($this);
205 $this->ctrl->forwardCommand($did);
206 break;
207
208 case 'ilexportgui':
209 $this->prepareOutput();
210 $this->tabs_gui->setTabActive('export');
211 include_once './Services/Export/classes/class.ilExportGUI.php';
212 $exp = new ilExportGUI($this);
213 $exp->addFormat('xml');
214 $this->ctrl->forwardCommand($exp);
215 break;
216
217 case 'ilobjecttranslationgui':
218 $this->checkPermissionBool("write");
219 $this->prepareOutput();
220 //$this->tabs_gui->setTabActive('export');
221 $this->setEditTabs("settings_trans");
222 include_once("./Services/Object/classes/class.ilObjectTranslationGUI.php");
223 $transgui = new ilObjectTranslationGUI($this);
224 $this->ctrl->forwardCommand($transgui);
225 break;
226
227 case 'ilobjtaxonomygui':
228 $this->checkPermissionBool("write");
229 $this->prepareOutput();
230 $this->initTaxSubTabs();
231 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php");
232 $tax = new ilObjTaxonomyGUI();
233 $tax->setAssignedObject($this->object->getId());
234 $tax->setMultiple(true);
235 $tax->setListInfo($this->lng->txt("cntr_tax_list_info"));
236 $this->ctrl->forwardCommand($tax);
237 break;
238
239 case 'ilobjectmetadatagui':
240 $this->checkPermissionBool("write");
241 $this->prepareOutput();
242 $this->tabs_gui->activateTab('meta_data');
243 $this->ctrl->forwardCommand($this->getObjectMetadataGUI());
244 break;
245
246 case "ilcontainernewssettingsgui":
247 $this->prepareOutput();
248 $this->tabs_gui->setTabActive('settings');
249 $this->setEditTabs();
250 $this->tabs_gui->activateSubTab('obj_news_settings');
251 $news_set_gui = new ilContainerNewsSettingsGUI($this);
252 $news_set_gui->setHideByDate(true);
253 $this->ctrl->forwardCommand($news_set_gui);
254 break;
255
256 case 'ilcontainerfilteradmingui':
257 $this->checkPermissionBool("write");
258 $this->prepareOutput();
259 $this->setEditTabs($active_tab = "settings_filter");
260 $this->tabs_gui->activateTab('settings');
261 $this->ctrl->forwardCommand(new ilContainerFilterAdminGUI($this));
262 break;
263
264 default:
265 if ($cmd == "infoScreen") {
266 $this->checkPermission("visible");
267 } else {
268 $this->checkPermission("read");
269 }
270
271 // add entry to navigation history
272 if (!$this->getCreationMode() &&
273 $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
274 include_once("./Services/Link/classes/class.ilLink.php");
275 $ilNavigationHistory->addItem(
276 $_GET["ref_id"],
277 ilLink::_getLink($_GET["ref_id"], "cat"),
278 "cat"
279 );
280 }
281
282 $this->prepareOutput();
283 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
284 if (is_object($this->object)) {
285 $this->tpl->setVariable(
286 "LOCATION_CONTENT_STYLESHEET",
287 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
288 );
289 }
290
291 if (!$cmd) {
292 $cmd = "render";
293 }
294 $cmd .= "Object";
295 $this->tabs_gui->activateTab("view_content"); // see #19868
296 $this->$cmd();
297
298 break;
299 }
300
301 $this->addHeaderAction();
302
303 return true;
304 }
305
306
310 protected function addHeaderAction()
311 {
313 parent::addHeaderAction();
314 }
315
316
323 public function getObjectMetadataGUI()
324 {
325 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
326 $md_gui = new ilObjectMetaDataGUI($this->object);
327 include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
329 $this->object->getId(),
331 false
332 )) {
333 $md_gui->enableTaxonomyDefinition(true);
334 $tax = $md_gui->getTaxonomyObjGUI();
335 $tax->setMultiple(true);
336 $tax->setListInfo($this->lng->txt("cntr_tax_list_info"));
337 $taxonomies = $this->getTaxonomiesForRefId();
338 if (sizeof($taxonomies)) {
339 $md_gui->setTaxonomySettings(function ($form) {
340 $tax = $this->getTaxonomiesForRefId();
341 $block = new ilCheckboxGroupInputGUI($this->lng->txt("cntr_taxonomy_show_sideblock"), "sblock");
342 $form->addItem($block);
343
344 $current = $this->getActiveBlocks();
345
346 foreach ($tax as $tax_id => $tax_item) {
347 $option = new ilCheckboxOption(
348 $tax_item["title"],
349 $tax_id,
351 );
352
353 if ($tax_item["source"] != $this->object->getRefId()) {
354 $loc = new ilLocatorGUI();
355 $loc->setTextOnly(true);
356 $loc->addRepositoryItems($tax_item["source"]);
357 $option->setInfo($loc->getHTML());
358 }
359
360 $block->addOption($option);
361
362 if (in_array($tax_id, $current)) {
363 $value[] = $tax_id;
364 }
365 }
366
367 $block->setValue($value);
368 }, function ($form) {
369 $taxonomies = $this->getTaxonomiesForRefId();
370 if (sizeof($taxonomies)) {
371 $sblock = $form->getInput("sblock");
372
374
376 $this->object->getId(),
377 $prefix . "%",
378 true
379 );
380
381 if (is_array($sblock)) {
382 foreach ($sblock as $tax_id) {
384 $this->object->getId(),
385 $prefix . $tax_id,
386 1
387 );
388 }
389 }
390 }
391 });
392 }
393 }
394 return $md_gui;
395 }
396
397
401 public function getTabs()
402 {
405 $ilHelp = $this->help;
406 $ilAccess = $this->access;
407
408 if ($this->ctrl->getCmd() == "editPageContent") {
409 return;
410 }
411 #$this->ctrl->setParameter($this,"ref_id",$this->ref_id);
412
413 $ilHelp->setScreenIdComponent("cat");
414
415 if ($rbacsystem->checkAccess('read', $this->ref_id)) {
416 $force_active = ($_GET["cmd"] == "" || $_GET["cmd"] == "render")
417 ? true
418 : false;
419 $this->tabs_gui->addTab(
420 "view_content",
421 $lng->txt("content"),
422 $this->ctrl->getLinkTarget($this, "")
423 );
424
425 //BEGIN ChangeEvent add info tab to category object
426 if ($this->info_screen_enabled) {
427 $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
428 || strtolower($_GET["cmdClass"]) == "ilnotegui")
429 ? true
430 : false;
431 $this->tabs_gui->addTarget(
432 "info_short",
433 $this->ctrl->getLinkTargetByClass(
434 array("ilobjcategorygui", "ilinfoscreengui"),
435 "showSummary"
436 ),
437 array("showSummary","", "infoScreen"),
438 "",
439 "",
440 $force_active
441 );
442 }
443 //END ChangeEvent add info tab to category object
444 }
445
446 if ($rbacsystem->checkAccess('write', $this->ref_id)) {
447 $force_active = ($_GET["cmd"] == "edit")
448 ? true
449 : false;
450 $this->tabs_gui->addTarget(
451 "settings",
452 $this->ctrl->getLinkTarget($this, "edit"),
453 "edit",
454 get_class($this),
455 "",
456 $force_active
457 );
458
459
460
461 // metadata / taxonomies
462 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
463 $mdgui = new ilObjectMetaDataGUI($this->object);
465 $this->object->getId(),
467 false
468 )) {
469 $mdgui->enableTaxonomyDefinition(true);
470 }
471 $mdtab = $mdgui->getTab();
472 if ($mdtab) {
473 $this->tabs_gui->addTab(
474 "meta_data",
475 $this->lng->txt("meta_data"),
476 $mdtab
477 );
478 }
479 }
480
481 include_once './Services/User/classes/class.ilUserAccountSettings.php';
482 if (
483 ilUserAccountSettings::getInstance()->isLocalUserAdministrationEnabled() and
484 $rbacsystem->checkAccess('cat_administrate_users', $this->ref_id)) {
485 $this->tabs_gui->addTarget(
486 "administrate_users",
487 $this->ctrl->getLinkTarget($this, "listUsers"),
488 "listUsers",
489 get_class($this)
490 );
491 }
492
493 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
494 $this->tabs_gui->addTarget(
495 'export',
496 $this->ctrl->getLinkTargetByClass('ilexportgui', ''),
497 'export',
498 'ilexportgui'
499 );
500 }
501
502 // parent tabs (all container: edit_permission, clipboard, trash
503 parent::getTabs();
504 }
505
509 public function renderObject()
510 {
511 $ilTabs = $this->tabs;
512
513 $ilTabs->activateTab("view_content");
514 $ret = parent::renderObject();
515 return $ret;
516 }
517
518 public function viewObject()
519 {
520 if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
521 parent::viewObject();
522 return true;
523 }
524 return $this->renderObject();
525 }
526
527 protected function initCreationForms($a_new_type)
528 {
529 $forms = parent::initCreationForms($a_new_type);
530 //unset($forms[self::CFORM_IMPORT]);
531 return $forms;
532 }
533
534 protected function afterSave(ilObject $a_new_object)
535 {
537
538 // default: sort by title
539 include_once('Services/Container/classes/class.ilContainerSortingSettings.php');
540 $settings = new ilContainerSortingSettings($a_new_object->getId());
542 $settings->save();
543
544 // inherit parents content style, if not individual
545 $parent_ref_id = $tree->getParentId($a_new_object->getRefId());
546 $parent_id = ilObject::_lookupObjId($parent_ref_id);
547 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
548 $style_id = ilObjStyleSheet::lookupObjectStyle($parent_id);
549 if ($style_id > 0) {
550 if (ilObjStyleSheet::_lookupStandard($style_id)) {
551 ilObjStyleSheet::writeStyleUsage($a_new_object->getId(), $style_id);
552 }
553 }
554
555 // always send a message
556 ilUtil::sendSuccess($this->lng->txt("cat_added"), true);
557 $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
558 $this->redirectToRefId($a_new_object->getRefId(), "");
559 }
560
566 public function infoScreenObject()
567 {
568 $this->ctrl->setCmd("showSummary");
569 $this->ctrl->setCmdClass("ilinfoscreengui");
570 $this->infoScreen();
571 }
572
576 public function infoScreen()
577 {
578 $ilAccess = $this->access;
581
582 if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
583 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
584 }
585
586 if (!$this->info_screen_enabled) {
587 return;
588 }
589
590 // #10986
591 $this->tabs_gui->setTabActive('info_short');
592
593 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
594 $info = new ilInfoScreenGUI($this);
595
596 $info->enablePrivateNotes();
597
598 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
599 $info->enableNews();
600 }
601
602 // no news editing for files, just notifications
603 $info->enableNewsEditing(false);
604 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
605 $news_set = new ilSetting("news");
606 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
607
608 if ($enable_internal_rss) {
609 $info->setBlockProperty("news", "settings", true);
610 $info->setBlockProperty("news", "public_notifications_option", true);
611 }
612 }
613
614 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
615 $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'cat', $this->object->getId());
616 $record_gui->setInfoObject($info);
617 $record_gui->parse();
618
619
620 // standard meta data
621 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
622
623 // forward the command
624 if ($ilCtrl->getNextClass() == "ilinfoscreengui") {
625 $ilCtrl->forwardCommand($info);
626 } else {
627 return $ilCtrl->getHTML($info);
628 }
629 }
630
636 protected function editInfoObject()
637 {
638 $this->checkPermission("write");
639 $this->setEditTabs();
640 $this->tabs_gui->activateTab('settings');
641 $this->tabs_gui->setSubTabActive('edit_cat_settings');
642
643 $this->initExtendedSettings();
644 $this->tpl->setContent($this->form->getHTML());
645 }
646
652 protected function updateInfoObject()
653 {
654 $this->checkPermission("write");
655
656 // init form
657 $this->initExtendedSettings();
658
659 // still needed for date conversion and so on
660 $this->form->checkInput();
661
662 if ($this->record_gui->importEditFormPostValues()) {
663 $this->record_gui->writeEditForm();
664
665 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
666 $this->ctrl->redirect($this, "editInfo");
667 }
668
669 $this->editInfoObject();
670 }
671
672
678 protected function initExtendedSettings()
679 {
680 if (is_object($this->form)) {
681 return true;
682 }
683
684 include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
685 $this->form = new ilPropertyFormGUI();
686 $this->form->setFormAction($this->ctrl->getFormAction($this));
687 $this->form->setTitle($this->lng->txt('ext_cat_settings'));
688 $this->form->addCommandButton('updateInfo', $this->lng->txt('save'));
689 $this->form->addCommandButton('editInfo', $this->lng->txt('cancel'));
690
691 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
692 $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'cat', $this->object->getId());
693 $this->record_gui->setPropertyForm($this->form);
694 $this->record_gui->parse();
695
696 return true;
697 }
698
699 protected function setEditTabs($active_tab = "settings_misc")
700 {
702 $ilTabs = $this->tabs;
703
704 $this->tabs_gui->addSubTab(
705 "settings_misc",
706 $this->lng->txt("settings"),
707 $this->ctrl->getLinkTarget($this, "edit")
708 );
709
710 $this->tabs_gui->addSubTab(
711 "settings_trans",
712 $this->lng->txt("obj_multilinguality"),
713 $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "")
714 );
715
716 //news tab
718 $this->object->getId(),
720 true
721 );
722
723 if ($news_active) {
724 $this->tabs_gui->addSubTab(
725 'obj_news_settings',
726 $this->lng->txt("cont_news_settings"),
727 $this->ctrl->getLinkTargetByClass('ilcontainernewssettingsgui')
728 );
729 }
730
731 $this->tabs_gui->addSubTab(
732 "settings_filter",
733 $this->lng->txt("cont_filter"),
734 $this->ctrl->getLinkTargetByClass("ilcontainerfilteradmingui", "")
735 );
736
737 $this->tabs_gui->activateTab("settings");
738 $this->tabs_gui->activateSubTab($active_tab);
739 }
740
741 public function initEditForm()
742 {
743 $obj_service = $this->getObjectService();
744
745 $this->lng->loadLanguageModule($this->object->getType());
746 $this->setEditTabs();
747
748 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
749 $form = new ilPropertyFormGUI();
750 $form->setFormAction($this->ctrl->getFormAction($this));
751 $form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
752
753 // title/description
754 $this->initFormTitleDescription($form);
755
756 // Show didactic template type
757 $this->initDidacticTemplate($form);
758
759 // presentation
760 $pres = new ilFormSectionHeaderGUI();
761 $pres->setTitle($this->lng->txt('obj_presentation'));
762 $form->addItem($pres);
763
764 // title and icon visibility
765 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTitleIconVisibility();
766
767 // top actions visibility
768 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTopActionsVisibility();
769
770 // custom icon
771 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addIcon();
772
773 // tile image
774 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
775
776 // list presentation
777 $form = $this->initListPresentationForm($form);
778
779 // sorting
780 $form = $this->initSortingForm(
781 $form,
782 array(
786 )
787 );
788
789 // block limit
790 $bl = new ilNumberInputGUI($this->lng->txt("cont_block_limit"), "block_limit");
791 $bl->setInfo($this->lng->txt("cont_block_limit_info"));
792 $bl->setValue(ilContainer::_lookupContainerSetting($this->object->getId(), "block_limit"));
793 $form->addItem($bl);
794
795 // icon settings
796
797 // Edit ecs export settings
798 include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
799 $ecs = new ilECSCategorySettings($this->object);
800 $ecs->addSettingsToForm($form, 'cat');
801
802 // services
803 $sh = new ilFormSectionHeaderGUI();
804 $sh->setTitle($this->lng->txt('obj_features'));
805 $form->addItem($sh);
806
807 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
809 $this->object->getId(),
810 $form,
811 array(
818 )
819 );
820
821 $form->addCommandButton("update", $this->lng->txt("save"));
822
823 return $form;
824 }
825
826 public function getEditFormValues()
827 {
828 // values are set in initEditForm()
829 }
830
836 public function updateObject()
837 {
840 $obj_service = $this->getObjectService();
841
842 if (!$this->checkPermissionBool("write")) {
843 $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
844 } else {
845 $form = $this->initEditForm();
846 if ($form->checkInput()) {
847 $title = $form->getInput("title");
848 $desc = $form->getInput("desc");
849
850 $this->object->setTitle($title);
851 $this->object->setDescription($desc);
852 $this->object->update();
853
854 $this->saveSortingSettings($form);
855
856 // title icon visibility
857 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTitleIconVisibility();
858
859 // top actions visibility
860 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTopActionsVisibility();
861
862 // custom icon
863 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();
864
865 // tile image
866 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
867
868 // list presentation
869 $this->saveListPresentation($form);
870
871 // BEGIN ChangeEvent: Record update
872 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
873 ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
874 ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
875 // END ChangeEvent: Record update
876
877 // services
878 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
880 $this->object->getId(),
881 $form,
882 array(
889 )
890 );
891
892 // block limit
893 if ((int) $form->getInput("block_limit") > 0) {
894 ilContainer::_writeContainerSetting($this->object->getId(), "block_limit", (int) $form->getInput("block_limit"));
895 } else {
896 ilContainer::_deleteContainerSettings($this->object->getId(), "block_limit");
897 }
898 // Update ecs export settings
899 include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
900 $ecs = new ilECSCategorySettings($this->object);
901 if ($ecs->handleSettingsUpdate()) {
902 return $this->afterUpdate();
903 }
904 }
905
906 // display form to correct errors
907 $this->setEditTabs();
908 $form->setValuesByPost();
909 $this->tpl->setContent($form->getHTML());
910 }
911 }
912
917 {
918 ilObjCategoryGUI::_importCategoriesForm($this->ref_id, $this->tpl);
919 }
920
924 public static function _importCategoriesForm($a_ref_id, &$a_tpl)
925 {
926 global $DIC;
927
928 $lng = $DIC->language();
929 $rbacreview = $DIC->rbac()->review();
930 $ilCtrl = $DIC->ctrl();
931
932 $a_tpl->addBlockfile(
933 "ADM_CONTENT",
934 "adm_content",
935 "tpl.cat_import_form.html",
936 "Modules/Category"
937 );
938
939 $a_tpl->setVariable("FORMACTION", $ilCtrl->getFormActionByClass('ilObjCategoryGUI'));
940
941 $a_tpl->setVariable("TXT_IMPORT_CATEGORIES", $lng->txt("import_categories"));
942 $a_tpl->setVariable("TXT_HIERARCHY_OPTION", $lng->txt("import_cat_localrol"));
943 $a_tpl->setVariable("TXT_IMPORT_FILE", $lng->txt("import_file"));
944 $a_tpl->setVariable("TXT_IMPORT_TABLE", $lng->txt("import_cat_table"));
945
946 $a_tpl->setVariable("BTN_IMPORT", $lng->txt("import"));
947 $a_tpl->setVariable("BTN_CANCEL", $lng->txt("cancel"));
948
949 // NEED TO FILL ADOPT_PERMISSIONS HTML FORM....
950 $parent_role_ids = $rbacreview->getParentRoleIds($a_ref_id, true);
951
952 // sort output for correct color changing
953 ksort($parent_role_ids);
954
955 foreach ($parent_role_ids as $key => $par) {
956 if ($par["obj_id"] != SYSTEM_ROLE_ID) {
957 $check = ilUtil::formCheckbox(0, "adopt[]", $par["obj_id"], 1);
958 $output["adopt"][$key]["css_row_adopt"] = ilUtil::switchColor($key, "tblrow1", "tblrow2");
959 $output["adopt"][$key]["check_adopt"] = $check;
960 $output["adopt"][$key]["role_id"] = $par["obj_id"];
961 $output["adopt"][$key]["type"] = ($par["type"] == 'role' ? 'Role' : 'Template');
962 $output["adopt"][$key]["role_name"] = $par["title"];
963 }
964 }
965
966 //var_dump($output);
967
968 // BEGIN ADOPT PERMISSIONS
969 foreach ($output["adopt"] as $key => $value) {
970 $a_tpl->setCurrentBlock("ADOPT_PERM_ROW");
971 $a_tpl->setVariable("CSS_ROW_ADOPT", $value["css_row_adopt"]);
972 $a_tpl->setVariable("CHECK_ADOPT", $value["check_adopt"]);
973 $a_tpl->setVariable("LABEL_ID", $value["role_id"]);
974 $a_tpl->setVariable("TYPE", $value["type"]);
975 $a_tpl->setVariable("ROLE_NAME", $value["role_name"]);
976 $a_tpl->parseCurrentBlock();
977 }
978 }
979
980
986 public function importCancelledObject()
987 {
988 $this->ctrl->redirect($this);
989 }
990
994 public static function _getImportDir()
995 {
996 return ilUtil::getDataDir() . "/cat_import";
997 }
998
1002 public function importCategoriesObject()
1003 {
1005 // call to importCategories with $withrol = 0
1007 }
1008
1013 {
1014
1015 //echo "entra aqui";
1016 // call to importCategories with $withrol = 1
1018 }
1019
1024 public static function _importCategories($a_ref_id, $withrol_tmp)
1025 {
1026 global $DIC;
1027
1028 $lng = $DIC->language();
1029 $ilCtrl = $DIC->ctrl();
1030
1031 require_once("./Modules/Category/classes/class.ilCategoryImportParser.php");
1032
1033 $import_dir = ilObjCategoryGUI::_getImportDir();
1034
1035 // create user import directory if necessary
1036 if (!@is_dir($import_dir)) {
1037 ilUtil::createDirectory($import_dir);
1038 }
1039
1040 // move uploaded file to user import directory
1041
1042 $file_name = $_FILES["importFile"]["name"];
1043
1044 // added to prevent empty file names
1045 if (!strcmp($file_name, "")) {
1046 ilUtil::sendFailure($lng->txt("no_import_file_found"), true);
1047 $ilCtrl->redirectByClass('ilObjCategoryGUI');
1048 }
1049
1050 $parts = pathinfo($file_name);
1051 $full_path = $import_dir . "/" . $file_name;
1052 ilUtil::moveUploadedFile($_FILES["importFile"]["tmp_name"], $file_name, $full_path);
1053
1054 // unzip file
1055 ilUtil::unzip($full_path);
1056
1057 $subdir = basename($parts["basename"], "." . $parts["extension"]);
1058 $xml_file = $import_dir . "/" . $subdir . "/" . $subdir . ".xml";
1059 // CategoryImportParser
1060 //var_dump($_POST);
1061 $importParser = new ilCategoryImportParser($xml_file, $a_ref_id, $withrol_tmp);
1062 $importParser->startParsing();
1063
1064 ilUtil::sendSuccess($lng->txt("categories_imported"), true);
1065 $ilCtrl->redirectByClass('ilObjCategoryGUI');
1066 }
1067
1072 protected function resetFilterObject()
1073 {
1074 include_once("./Services/User/classes/class.ilUserTableGUI.php");
1075 $utab = new ilUserTableGUI($this, "listUsers", ilUserTableGUI::MODE_LOCAL_USER);
1076 $utab->resetOffset();
1077 $utab->resetFilter();
1078
1079 // from "old" implementation
1080 $this->listUsersObject();
1081 }
1082
1087 protected function applyFilterObject()
1088 {
1089 $ilTabs = $this->tabs;
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->writeFilterToSession();
1095 $this->listUsersObject();
1096 }
1097
1098 // METHODS for local user administration
1099 public function listUsersObject($show_delete = false)
1100 {
1103 $ilToolbar = $this->toolbar;
1104
1105 include_once './Services/User/classes/class.ilLocalUser.php';
1106 include_once './Services/User/classes/class.ilObjUserGUI.php';
1107
1110
1111 if (!$rbacsystem->checkAccess("cat_administrate_users", $this->object->getRefId())) {
1112 $ilErr->raiseError($this->lng->txt("msg_no_perm_admin_users"), $ilErr->MESSAGE);
1113 }
1114 $this->tabs_gui->setTabActive('administrate_users');
1115
1116
1117
1118 $this->tpl->addBlockfile(
1119 'ADM_CONTENT',
1120 'adm_content',
1121 'tpl.cat_admin_users.html',
1122 "Modules/Category"
1123 );
1124
1125 if (count($rbacreview->getGlobalAssignableRoles()) or in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1126 $ilToolbar->addButton(
1127 $this->lng->txt('add_user'),
1128 $this->ctrl->getLinkTargetByClass('ilobjusergui', 'create')
1129 );
1130
1131 $ilToolbar->addButton(
1132 $this->lng->txt('import_users'),
1133 $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'importUserForm')
1134 );
1135 } else {
1136 ilUtil::sendInfo($this->lng->txt('no_roles_user_can_be_assigned_to'));
1137 }
1138
1139 if ($show_delete) {
1140 $this->tpl->setCurrentBlock("confirm_delete");
1141 $this->tpl->setVariable("CONFIRM_FORMACTION", $this->ctrl->getFormAction($this));
1142 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt('cancel'));
1143 $this->tpl->setVariable("CONFIRM_CMD", 'performDeleteUsers');
1144 $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt('delete'));
1145 $this->tpl->parseCurrentBlock();
1146 }
1147
1148 $this->lng->loadLanguageModule('user');
1149
1150 include_once("./Services/User/classes/class.ilUserTableGUI.php");
1151 $utab = new ilUserTableGUI($this, 'listUsers', ilUserTableGUI::MODE_LOCAL_USER);
1152 $this->tpl->setVariable('USERS_TABLE', $utab->getHTML());
1153
1154 return true;
1155 }
1156
1160 protected function addUserAutoCompleteObject()
1161 {
1162 include_once './Services/User/classes/class.ilUserAutoComplete.php';
1163 $auto = new ilUserAutoComplete();
1164 $auto->setSearchFields(array('login','firstname','lastname','email'));
1165 $auto->enableFieldSearchableCheck(true);
1166 $auto->isMoreLinkAvailable(true);
1167
1168 if (($_REQUEST['fetchall'])) {
1169 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
1170 }
1171
1172 echo $auto->getList($_REQUEST['term']);
1173 exit();
1174 }
1175
1176
1178 {
1179 include_once './Services/User/classes/class.ilLocalUser.php';
1180 $this->checkPermission("cat_administrate_users");
1181
1182 foreach ($_POST['user_ids'] as $user_id) {
1183 if (!in_array($user_id, ilLocalUser::_getAllUserIds($this->object->getRefId()))) {
1184 die('user id not valid');
1185 }
1186 if (!$tmp_obj = &ilObjectFactory::getInstanceByObjId($user_id, false)) {
1187 continue;
1188 }
1189 $tmp_obj->delete();
1190 }
1191 ilUtil::sendSuccess($this->lng->txt('deleted_users'));
1192 $this->listUsersObject();
1193
1194 return true;
1195 }
1196
1197 public function deleteUsersObject()
1198 {
1199 $this->checkPermission("cat_administrate_users");
1200 if (!count($_POST['id'])) {
1201 ilUtil::sendFailure($this->lng->txt('no_users_selected'));
1202 $this->listUsersObject();
1203
1204 return true;
1205 }
1206
1207 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1208 $confirm = new ilConfirmationGUI();
1209 $confirm->setFormAction($this->ctrl->getFormAction($this));
1210 $confirm->setHeaderText($this->lng->txt('sure_delete_selected_users'));
1211 $confirm->setConfirm($this->lng->txt('delete'), 'performDeleteUsers');
1212 $confirm->setCancel($this->lng->txt('cancel'), 'listUsers');
1213
1214 foreach ($_POST['id'] as $user) {
1216
1217 $confirm->addItem(
1218 'user_ids[]',
1219 $user,
1220 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']'
1221 );
1222 }
1223 $this->tpl->setContent($confirm->getHTML());
1224 }
1225
1226 public function assignRolesObject()
1227 {
1229 $ilTabs = $this->tabs;
1230
1231 $this->checkPermission("cat_administrate_users");
1232
1233 include_once './Services/User/classes/class.ilLocalUser.php';
1234
1235 if (!isset($_GET['obj_id'])) {
1236 ilUtil::sendFailure('no_user_selected');
1237 $this->listUsersObject();
1238
1239 return true;
1240 }
1241
1242 $ilTabs->clearTargets();
1243 $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
1244 $ilHelp = $this->help;
1245 $ilHelp->setScreenIdComponent("cat");
1246 $ilHelp->setScreenId("administrate_user");
1247 $ilHelp->setSubScreenId("assign_roles");
1248
1249
1250 $roles = $this->__getAssignableRoles();
1251
1252 if (!count($roles)) {
1253 #ilUtil::sendInfo($this->lng->txt('no_roles_user_can_be_assigned_to'));
1254 #$this->listUsersObject();
1255
1256 #return true;
1257 }
1258
1259 $ass_roles = $rbacreview->assignedRoles($_GET['obj_id']);
1260
1261 $counter = 0;
1262 $f_result = array();
1263
1264 foreach ($roles as $role) {
1265 $role_obj = &ilObjectFactory::getInstanceByObjId($role['obj_id']);
1266
1267 $disabled = false;
1268 $f_result[$counter]['checkbox'] = ilUtil::formCheckbox(
1269 in_array($role['obj_id'], $ass_roles) ? 1 : 0,
1270 'role_ids[]',
1271 $role['obj_id'],
1272 $disabled
1273 );
1274 $f_result[$counter]['title'] = $role_obj->getTitle() ? $role_obj->getTitle() : "";
1275 $f_result[$counter]['desc'] = $role_obj->getDescription() ? $role_obj->getDescription() : "";
1276 $f_result[$counter]['type'] = $role['role_type'] == 'global' ?
1277 $this->lng->txt('global') :
1278 $this->lng->txt('local');
1279
1280 unset($role_obj);
1281 ++$counter;
1282 }
1283
1284 include_once('./Modules/Category/classes/class.ilCategoryAssignRoleTableGUI.php');
1285 $table = new ilCategoryAssignRoleTableGUI($this, "assignRoles");
1286 $tmp_obj = &ilObjectFactory::getInstanceByObjId($_GET['obj_id']);
1287 $title = $this->lng->txt('role_assignment') . ' (' . $tmp_obj->getFullname() . ')';
1288 $table->setTitle($title, "icon_role.svg", $this->lng->txt("role_assignment"));
1289 $table->setData($f_result);
1290 $this->tpl->setContent($table->getHTML());
1291 }
1292
1293 public function assignSaveObject()
1294 {
1297 $this->checkPermission("cat_administrate_users");
1298
1299 include_once './Services/User/classes/class.ilLocalUser.php';
1300 // check hack
1301 if (!isset($_GET['obj_id']) or !in_array($_REQUEST['obj_id'], ilLocalUser::_getAllUserIds())) {
1302 ilUtil::sendFailure('no_user_selected');
1303 $this->listUsersObject();
1304
1305 return true;
1306 }
1307 $roles = $this->__getAssignableRoles();
1308
1309 // check minimum one global role
1310 if (!$this->__checkGlobalRoles($_POST['role_ids'])) {
1311 ilUtil::sendFailure($this->lng->txt('no_global_role_left'));
1312 $this->assignRolesObject();
1313
1314 return false;
1315 }
1316
1317 $new_role_ids = $_POST['role_ids'] ? $_POST['role_ids'] : array();
1318 $assigned_roles = $rbacreview->assignedRoles((int) $_REQUEST['obj_id']);
1319 foreach ($roles as $role) {
1320 if (in_array($role['obj_id'], $new_role_ids) and !in_array($role['obj_id'], $assigned_roles)) {
1321 $rbacadmin->assignUser($role['obj_id'], (int) $_REQUEST['obj_id']);
1322 }
1323 if (in_array($role['obj_id'], $assigned_roles) and !in_array($role['obj_id'], $new_role_ids)) {
1324 $rbacadmin->deassignUser($role['obj_id'], (int) $_REQUEST['obj_id']);
1325 }
1326 }
1327 ilUtil::sendSuccess($this->lng->txt('role_assignment_updated'));
1328 $this->assignRolesObject();
1329
1330 return true;
1331 }
1332
1333 // PRIVATE
1334 public function __getAssignableRoles()
1335 {
1338
1339 // check local user
1340 $tmp_obj = &ilObjectFactory::getInstanceByObjId($_REQUEST['obj_id']);
1341 // Admin => all roles
1342 if (in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1343 $global_roles = $rbacreview->getGlobalRolesArray();
1344 } elseif ($tmp_obj->getTimeLimitOwner() == $this->object->getRefId()) {
1345 $global_roles = $rbacreview->getGlobalAssignableRoles();
1346 } else {
1347 $global_roles = array();
1348 }
1349 return $roles = array_merge(
1350 $global_roles,
1351 $rbacreview->getAssignableChildRoles($this->object->getRefId())
1352 );
1353 }
1354
1355 public function __checkGlobalRoles($new_assigned)
1356 {
1359
1360 $this->checkPermission("cat_administrate_users");
1361
1362 // return true if it's not a local user
1363 $tmp_obj = &ilObjectFactory::getInstanceByObjId($_REQUEST['obj_id']);
1364 if ($tmp_obj->getTimeLimitOwner() != $this->object->getRefId() and
1365 !in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1366 return true;
1367 }
1368
1369 // new assignment by form
1370 $new_assigned = $new_assigned ? $new_assigned : array();
1371 $assigned = $rbacreview->assignedRoles((int) $_GET['obj_id']);
1372
1373 // all assignable globals
1374 if (!in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId()))) {
1375 $ga = $rbacreview->getGlobalAssignableRoles();
1376 } else {
1377 $ga = $rbacreview->getGlobalRolesArray();
1378 }
1379 $global_assignable = array();
1380 foreach ($ga as $role) {
1381 $global_assignable[] = $role['obj_id'];
1382 }
1383
1384 $new_visible_assigned_roles = array_intersect($new_assigned, $global_assignable);
1385 $all_assigned_roles = array_intersect($assigned, $rbacreview->getGlobalRoles());
1386 $main_assigned_roles = array_diff($all_assigned_roles, $global_assignable);
1387
1388 if (!count($new_visible_assigned_roles) and !count($main_assigned_roles)) {
1389 return false;
1390 }
1391 return true;
1392 }
1393
1394 public static function _goto($a_target)
1395 {
1396 global $DIC;
1397
1398 $ilAccess = $DIC->access();
1399 $ilErr = $DIC["ilErr"];
1400 $lng = $DIC->language();
1401
1402 if ($ilAccess->checkAccess("read", "", $a_target)) {
1404 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1405 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1406 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1407 ilUtil::sendFailure(sprintf(
1408 $lng->txt("msg_no_perm_read_item"),
1410 ), true);
1412 }
1413
1414 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1415 }
1416
1417 //
1418 // taxonomy
1419 //
1420
1421 protected function initTaxSubTabs($a_active = "tax_list")
1422 {
1423 $this->tabs_gui->setTabActive("obj_tool_setting_taxonomies");
1424 $this->tabs_gui->addSubTab(
1425 "tax_settings",
1426 $this->lng->txt("cntr_taxonomy_sideblock_settings"),
1427 $this->ctrl->getLinkTarget($this, "editTaxonomySettings")
1428 );
1429 $this->tabs_gui->addSubTab(
1430 "tax_list",
1431 $this->lng->txt("cntr_taxonomy_definitions"),
1432 $this->ctrl->getLinkTargetByClass("ilobjtaxonomygui", "")
1433 );
1434 $this->tabs_gui->activateSubTab($a_active);
1435 }
1436
1437 protected function getTaxonomiesForRefId()
1438 {
1440
1441 include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
1442 include_once "Services/Taxonomy/classes/class.ilObjTaxonomy.php";
1443
1444 // see ilTaxMDGUI::getSelectableTaxonomies()
1445
1446 $res = array();
1447 foreach ($tree->getPathFull($this->object->getRefId()) as $node) {
1448 //if ($node["ref_id"] != $this->object->getRefId())
1449 {
1450 // find all defined taxes for parent node, activation is not relevant
1451 $node_taxes = ilObjTaxonomy::getUsageOfObject($node["obj_id"], true);
1452 if (sizeof($node_taxes)) {
1453 foreach ($node_taxes as $node_tax) {
1454 $res[$node_tax["tax_id"]] = array(
1455 "title" => $node_tax["title"]
1456 , "source" => $node["child"]
1457 );
1458 }
1459 }
1460 }
1461 }
1462
1463 asort($res);
1464 return $res;
1465 }
1466
1467
1468 protected function getActiveBlocks()
1469 {
1470 $res = array();
1471
1473
1474 foreach (ilContainer::_getContainerSettings($this->object->getId()) as $keyword => $value) {
1475 if (substr($keyword, 0, strlen($prefix)) == $prefix && (bool) $value) {
1476 $res[] = substr($keyword, strlen($prefix));
1477 }
1478 }
1479
1480 return $res;
1481 }
1482} // 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 _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($a_file, $overwrite=false, $a_flat=false)
unzip file
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static createDirectory($a_dir, $a_mod=0755)
create directory
help()
Definition: help.php:2
global $ilCtrl
Definition: ilias.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
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46