ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjContentPageGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8
26{
28 protected $request;
30 protected $ctrl;
32 protected $access;
34 protected $settings;
36 protected $tabs;
38 protected $user;
40 protected $obj_service;
42 protected $navHistory;
44 protected $error;
46 protected $dic;
48 protected $infoScreenEnabled = false;
52 private $uiServices;
53
55 protected $help;
58
62 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
63 {
64 global $DIC;
65
66 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
67
68 $this->dic = $DIC;
69 $this->request = $this->dic->http()->request();
70 $this->settings = $this->dic->settings();
71 $this->access = $this->dic->access();
72 $this->ctrl = $this->dic->ctrl();
73 $this->tabs = $this->dic->tabs();
74 $this->user = $this->dic->user();
75 $this->obj_service = $this->dic->object();
76 $this->navHistory = $this->dic['ilNavigationHistory'];
77 $this->error = $this->dic['ilErr'];
78 $this->help = $DIC['ilHelp'];
79 $this->uiServices = $DIC->ui();
80
81 $this->lng->loadLanguageModule('copa');
82 $this->lng->loadLanguageModule('style');
83 $this->lng->loadLanguageModule('content');
84
85 if ($this->object instanceof ilObjContentPage) {
86 $this->infoScreenEnabled = ilContainer::_lookupContainerSetting(
87 $this->object->getId(),
89 true
90 );
91 }
92
93 $this->in_page_editor_style_context = (
94 $this->dic->http()->request()->getQueryParams()[self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT] ?? null
95 );
96
97 $this->pageMetricsService = new PageMetricsService(
98 new PageMetricsRepositoryImp($DIC->database()),
99 $DIC->refinery()
100 );
101
102 $this->ctrl->saveParameter($this, self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT);
103 }
104
108 public static function _goto(string $target) : void
109 {
110 global $DIC;
111
112 $targetAttributes = explode('_', $target);
113 $refId = (int) $targetAttributes[0];
114
115 if ((int) $refId <= 0) {
116 $DIC['ilErr']->raiseError($DIC->language()->txt('msg_no_perm_read'), $DIC['ilErr']->FATAL);
117 }
118
119 if ($DIC->access()->checkAccess('read', '', $refId)) {
120 $DIC->ctrl()->setTargetScript('ilias.php');
121 $DIC->ctrl()->initBaseClass('ilRepositoryGUI');
122 if (isset($DIC->http()->request()->getQueryParams()['gotolp'])) {
123 $DIC->ctrl()->setParameterByClass(__CLASS__, 'gotolp', 1);
124 }
125 $DIC->ctrl()->setParameterByClass(__CLASS__, 'ref_id', $refId);
126 $DIC->ctrl()->redirectByClass([
127 'ilRepositoryGUI',
128 __CLASS__,
129 ], self::UI_CMD_VIEW);
130 } elseif ($DIC->access()->checkAccess("visible", "", $target)) {
131 ilObjectGUI::_gotoRepositoryNode($target, "infoScreen");
132 } elseif ($DIC->access()->checkAccess('read', '', ROOT_FOLDER_ID)) {
133 ilUtil::sendInfo(sprintf(
134 $DIC->language()->txt('msg_no_perm_read_item'),
136 ), true);
137
138 $DIC->ctrl()->setTargetScript('ilias.php');
139 $DIC->ctrl()->initBaseClass('ilRepositoryGUI');
140 $DIC->ctrl()->setParameterByClass('ilRepositoryGUI', 'ref_id', ROOT_FOLDER_ID);
141 $DIC->ctrl()->redirectByClass('ilRepositoryGUI');
142 }
143
144 $DIC['ilErr']->raiseError($DIC->language()->txt('msg_no_perm_read'), $DIC['ilErr']->FATAL);
145 }
146
150 public function getType()
151 {
152 return self::OBJ_TYPE;
153 }
154
158 public function setTabs()
159 {
160 $this->help->setScreenIdComponent($this->object->getType());
161
162 if ($this->in_page_editor_style_context) {
163 return;
164 }
165
166 if ($this->checkPermissionBool('read')) {
167 $this->tabs->addTab(
168 self::UI_TAB_ID_CONTENT,
169 $this->lng->txt('content'),
170 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
171 );
172 }
173
174 if ($this->infoScreenEnabled && ($this->checkPermissionBool('visible') || $this->checkPermissionBool('read'))) {
175 $this->tabs->addTab(
176 self::UI_TAB_ID_INFO,
177 $this->lng->txt('info_short'),
178 $this->ctrl->getLinkTargetByClass('ilinfoscreengui', 'showSummary')
179 );
180 }
181
182 if ($this->checkPermissionBool('write')) {
183 $this->tabs->addTab(
184 self::UI_TAB_ID_SETTINGS,
185 $this->lng->txt('settings'),
186 $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
187 );
188 }
189
190 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
191 $this->tabs->addTab(
192 self::UI_TAB_ID_LP,
193 $this->lng->txt('learning_progress'),
194 $this->ctrl->getLinkTargetByClass('illearningprogressgui')
195 );
196 }
197
198 if ($this->checkPermissionBool('write')) {
199 $this->tabs->addTab(
200 self::UI_TAB_ID_EXPORT,
201 $this->lng->txt('export'),
202 $this->ctrl->getLinkTargetByClass('ilexportgui')
203 );
204 }
205
206 if ($this->checkPermissionBool('edit_permission')) {
207 $this->tabs->addTab(
208 self::UI_TAB_ID_PERMISSIONS,
209 $this->lng->txt('perm_settings'),
210 $this->ctrl->getLinkTargetByClass('ilpermissiongui', 'perm')
211 );
212 }
213 }
214
221 public function executeCommand()
222 {
223 $nextClass = $this->ctrl->getNextClass($this);
224 $cmd = $this->ctrl->getCmd(self::UI_CMD_VIEW);
225
226 $this->addToNavigationHistory();
227
228 if (
229 !$this->in_page_editor_style_context &&
230 strtolower($nextClass) !== strtolower(ilObjStyleSheetGUI::class) &&
231 (
232 strtolower($cmd) !== strtolower(self::UI_CMD_EDIT) ||
233 strtolower($nextClass) !== strtolower(ilContentPagePageGUI::class)
234 )
235 ) {
236 $this->renderHeaderActions();
237 }
238
239 switch (strtolower($nextClass)) {
240 case 'ilobjecttranslationgui':
241 $this->checkPermission('write');
242
243 $this->prepareOutput();
244 $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
245 $this->setSettingsSubTabs(self::UI_TAB_ID_I18N);
246
247 $transgui = new ilObjectTranslationGUI($this);
248 $this->ctrl->forwardCommand($transgui);
249 break;
250
251 case 'ilobjstylesheetgui':
252 $this->checkPermission('write');
253
254 $this->setLocator();
255
256 $this->ctrl->setReturn($this, 'editStyleProperties');
257 $style_gui = new ilObjStyleSheetGUI(
258 '',
259 $this->object->getStyleSheetId(),
260 false,
261 false
262 );
263 $style_gui->omitLocator();
264 if ($cmd === 'create' || $_GET['new_type'] === 'sty') {
265 $style_gui->setCreationMode(true);
266 }
267
268 if ($cmd === 'confirmedDelete') {
269 $this->object->setStyleSheetId(0);
270 $this->object->update();
271 }
272
273 $ret = $this->ctrl->forwardCommand($style_gui);
274
275 if ($cmd === 'save' || $cmd === 'copyStyle' || $cmd === 'importStyle') {
276 $styleId = $ret;
277 $this->object->setStyleSheetId($styleId);
278 $this->object->update();
279 $this->ctrl->redirectByClass('ilobjstylesheetgui', 'edit');
280 }
281 break;
282
283 case 'ilcontentpagepagegui':
284 $isMediaRequest = in_array(strtolower($cmd), array_map('strtolower', [
285 self::UI_CMD_COPAGE_DOWNLOAD_FILE,
286 self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN,
287 self::UI_CMD_COPAGE_DISPLAY_MEDIA,
288 self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH,
289 ]), true);
290 if ($isMediaRequest) {
291 if (!$this->checkPermissionBool('read')) {
292 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
293 }
294 } elseif (!$this->checkPermissionBool('write') || $this->user->isAnonymous()) {
295 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
296 }
297
298 $this->prepareOutput();
299
300 $this->tpl->setVariable(
301 'LOCATION_CONTENT_STYLESHEET',
302 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
303 );
304 $this->tpl->setCurrentBlock('SyntaxStyle');
305 $this->tpl->setVariable('LOCATION_SYNTAX_STYLESHEET', ilObjStyleSheet::getSyntaxStylePath());
306 $this->tpl->parseCurrentBlock();
307
308 $forwarder = new ilContentPagePageCommandForwarder(
309 $this->request,
310 $this->ctrl,
311 $this->tabs,
312 $this->lng,
313 $this->object,
314 $this->user
315 );
316 $forwarder->setIsMediaRequest($isMediaRequest);
317
318 $forwarder->addUpdateListener(function (PageUpdatedEvent $event) : void {
319 $this->pageMetricsService->store(
321 (int) $this->object->getId(),
322 $event->page()->getLanguage()
323 )
324 );
325 });
326
327 $pageContent = $forwarder->forward();
328 if (strlen($pageContent) > 0) {
329 $this->tpl->setContent($pageContent);
330 }
331 break;
332
333 case 'ilinfoscreengui':
334 if (!$this->infoScreenEnabled) {
335 return null;
336 }
337 $this->prepareOutput();
338
339 $this->infoScreenForward();
340 break;
341
342 case 'ilcommonactiondispatchergui':
343 $this->prepareOutput();
344 $this->ctrl->forwardCommand(ilCommonActionDispatcherGUI::getInstanceFromAjaxCall());
345 break;
346
347 case 'ilpermissiongui':
348 $this->checkPermission('edit_permission');
349
350 $this->prepareOutput();
351 $this->tabs->activateTab(self::UI_TAB_ID_PERMISSIONS);
352
353 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
354 break;
355
356 case 'illearningprogressgui':
357 if (!ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
358 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
359 }
360
361 $this->prepareOutput();
362 $this->tabs->activateTab(self::UI_TAB_ID_LP);
363
364 $this->ctrl->forwardCommand(new ilLearningProgressGUI(
366 $this->object->getRefId(),
367 isset(
368 $this->request->getQueryParams()['user_id']) &&
369 is_numeric(
370 $this->request->getQueryParams()['user_id']
371 ) ?
372 (int) $this->request->getQueryParams()['user_id'] :
373 $this->user->getId()
374 ));
375 break;
376
377 case 'ilexportgui':
378 $this->checkPermission('write');
379
380 $this->prepareOutput();
381 $this->tabs->activateTab(self::UI_TAB_ID_EXPORT);
382
383 $gui = new ilExportGUI($this);
384 $gui->addFormat('xml');
385 $this->ctrl->forwardCommand($gui);
386 break;
387
388 case 'ilobjectcustomiconconfigurationgui':
389 if (!$this->checkPermissionBool('write') || !$this->settings->get('custom_icons')) {
390 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
391 }
392
393 $this->prepareOutput();
394 $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
395 $this->setSettingsSubTabs(self::UI_TAB_ID_ICON);
396
397 require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconConfigurationGUI.php';
398 $gui = new ilObjectCustomIconConfigurationGUI($this->dic, $this, $this->object);
399 $this->ctrl->forwardCommand($gui);
400 break;
401
402 case 'ilobjectcopygui':
403 $this->tpl->loadStandardTemplate();
404
405 $gui = new ilObjectCopyGUI($this);
406 $gui->setType(self::OBJ_TYPE);
407
408 $this->ctrl->forwardCommand($gui);
409 break;
410
411 default:
412 switch (true) {
413 case in_array(strtolower($cmd), array_map('strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE])):
414 $this->setSettingsSubTabs(self::UI_TAB_ID_SETTINGS);
415 break;
416 }
417
418 if (in_array(strtolower($cmd), array_map('strtolower', ['addToDesk', 'removeFromDesk']))) {
419 $this->ctrl->setCmd($cmd . 'Object');
420 }
421
422 return parent::executeCommand();
423 }
424 return null;
425 }
426
427 public function addToNavigationHistory() : void
428 {
429 if (!$this->getCreationMode()) {
430 if ($this->checkPermissionBool('read')) {
431 $this->navHistory->addItem(
432 $this->object->getRefId(),
433 ilLink::_getLink($this->object->getRefId(), $this->object->getType()),
434 $this->object->getType()
435 );
436 }
437 }
438 }
439
440 public function renderHeaderActions() : void
441 {
442 if (!$this->getCreationMode()) {
443 if ($this->checkPermissionBool('read')) {
444 $this->addHeaderAction();
445 }
446 }
447 }
448
452 public function infoScreenForward() : void
453 {
454 if (!$this->infoScreenEnabled) {
455 return;
456 }
457
458 if (!$this->checkPermissionBool('visible') && !$this->checkPermissionBool('read')) {
459 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
460 }
461
462 $this->tabs->activateTab(self::UI_TAB_ID_INFO);
463
464 $info = new ilInfoScreenGUI($this);
465 $info->enableLearningProgress(true);
466 $info->enablePrivateNotes();
467 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
468
469 $this->ctrl->forwardCommand($info);
470 }
471
476 protected function setSettingsSubTabs(string $activeTab) : void
477 {
478 if ($this->checkPermissionBool('write')) {
479 $this->tabs->addSubTab(
480 self::UI_TAB_ID_SETTINGS,
481 $this->lng->txt('settings'),
482 $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
483 );
484
485 if ($this->settings->get('custom_icons')) {
486 $this->tabs_gui->addSubTab(
487 self::UI_TAB_ID_ICON,
488 $this->lng->txt('icon_settings'),
489 $this->ctrl->getLinkTargetByClass('ilObjectCustomIconConfigurationGUI')
490 );
491 }
492
493 $this->tabs_gui->addSubTab(
494 self::UI_TAB_ID_STYLE,
495 $this->lng->txt('cont_style'),
496 $this->ctrl->getLinkTarget($this, 'editStyleProperties')
497 );
498
499 $this->tabs_gui->addSubTab(
500 self::UI_TAB_ID_I18N,
501 $this->lng->txt('obj_multilinguality'),
502 $this->ctrl->getLinkTargetByClass(ilObjectTranslationGUI::class)
503 );
504
505 $this->tabs->activateSubTab($activeTab);
506 }
507 }
508
512 public function addLocatorItems()
513 {
514 if ($this->object instanceof ilObject) {
515 $this->locator->addItem(
516 $this->object->getTitle(),
517 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
518 '',
519 $this->object->getRefId()
520 );
521 }
522 }
523
528 public function infoScreen() : void
529 {
530 $this->ctrl->setCmd('showSummary');
531 $this->ctrl->setCmdClass('ilinfoscreengui');
532
533 $this->infoScreenForward();
534 }
535
536
542 public function view()
543 {
544 $this->checkPermission('read');
545
546 $this->populateContentToolbar();
547
548 $this->tabs->activateTab(self::UI_TAB_ID_CONTENT);
549
550 $this->tpl->setPermanentLink($this->object->getType(), $this->object->getRefId(), '', '_top');
551
552 $this->tpl->setContent($this->getContent());
553 }
554
555 protected function populateContentToolbar() : void
556 {
557 if (!$this->user->isAnonymous() && $this->checkPermissionBool('write')) {
558 $this->lng->loadLanguageModule('cntr');
559 $this->toolbar->addComponent(
560 $this->uiServices->factory()->button()->primary(
561 $this->lng->txt('cntr_text_media_editor'),
562 $this->ctrl->getLinkTargetByClass(ilContentPagePageGUI::class, 'edit')
563 )
564 );
565 }
566 }
567
573 public function getContent(string $ctrlLink = '') : string
574 {
575 if ($this->checkPermissionBool('read')) {
576 $this->object->trackProgress((int) $this->user->getId());
577
578 $this->initStyleSheets();
579
580 $forwarder = new ilContentPagePageCommandForwarder(
581 $this->request,
582 $this->ctrl,
583 $this->tabs,
584 $this->lng,
585 $this->object,
586 $this->user
587 );
589
590 return $forwarder->forward($ctrlLink);
591 }
592
593 return '';
594 }
595
596 protected function initStyleSheets() : void
597 {
598 $this->tpl->setVariable(
599 'LOCATION_CONTENT_STYLESHEET',
600 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
601 );
602 $this->tpl->setCurrentBlock('SyntaxStyle');
603 $this->tpl->setVariable('LOCATION_SYNTAX_STYLESHEET', ilObjStyleSheet::getSyntaxStylePath());
604 $this->tpl->parseCurrentBlock();
605 }
606
610 protected function afterSave(ilObject $a_new_object)
611 {
612 $a_new_object->getObjectTranslation()->addLanguage(
613 $this->lng->getDefaultLanguage(),
614 $a_new_object->getTitle(),
615 $a_new_object->getDescription(),
616 true,
617 true
618 );
619 $a_new_object->getObjectTranslation()->save();
620
621 ilUtil::sendSuccess($this->lng->txt('object_added'), true);
622 $this->ctrl->redirect($this, 'edit');
623 }
624
628 protected function setTitleAndDescription()
629 {
630 parent::setTitleAndDescription();
631
632 $icon = ilObject::_getIcon($this->object->getId(), 'big', $this->object->getType());
633 $this->tpl->setTitleIcon($icon, $this->lng->txt('obj_' . $this->object->getType()));
634 }
635
639 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
640 {
641 $sh = new ilFormSectionHeaderGUI();
642 $sh->setTitle($this->lng->txt('obj_features'));
643 $a_form->addItem($sh);
644
646 $this->object->getId(),
647 $a_form,
648 [
650 ]
651 );
652
653 $presentationHeader = new ilFormSectionHeaderGUI();
654 $presentationHeader->setTitle($this->lng->txt('settings_presentation_header'));
655 $a_form->addItem($presentationHeader);
656 $this->obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
657
658 if ($this->getCreationMode() !== true && count($this->object->getObjectTranslation()->getLanguages()) > 1) {
659 $languages = ilMDLanguageItem::_getLanguages();
660 $a_form->getItemByPostVar('title')
661 ->setInfo(
662 implode(
663 ': ',
664 [
665 $this->lng->txt('language'),
666 $languages[$this->object->getObjectTranslation()->getDefaultLanguage()]
667 ]
668 )
669 );
670 }
671 }
672
676 protected function getEditFormCustomValues(array &$a_values)
677 {
679
680 if (count($this->object->getObjectTranslation()->getLanguages()) > 1) {
681 $a_values['title'] = $this->object->getObjectTranslation()->getDefaultTitle();
682 $a_values['desc'] = $this->object->getObjectTranslation()->getDefaultDescription();
683 }
684 }
685
689 protected function updateCustom(ilPropertyFormGUI $a_form)
690 {
692 $this->object->getId(),
693 $a_form,
694 [
696 ]
697 );
698 $this->obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
699 }
700
704 protected function editStyleProperties() : void
705 {
706 $this->checkPermission('write');
707
708 if (!$this->in_page_editor_style_context) {
709 $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
710 $this->setSettingsSubTabs(self::UI_TAB_ID_STYLE);
711 }
712
713 $form = $this->buildStylePropertiesForm();
714
715 if ($this->in_page_editor_style_context) {
716 $this->tabs->setBackTarget(
717 $this->lng->txt('back'),
718 $this->ctrl->getLinkTargetByClass(ilContentPagePageGUI::class, 'edit')
719 );
720
721 $forwarder = new ilContentPagePageCommandForwarder(
722 $this->request,
723 $this->ctrl,
724 $this->tabs,
725 $this->lng,
726 $this->object,
727 $this->user
728 );
730 $forwarder->forward('');
731 $this->tabs->setTabActive('obj_sty');
732 }
733 $this->tpl->setContent($form->getHTML());
734 }
735
740 {
741 $form = new ilPropertyFormGUI();
742
743 $fixedStyle = $this->settings->get('fixed_content_style_id');
744 $defaultStyle = $this->settings->get('default_content_style_id');
745 $styleId = $this->object->getStyleSheetId();
746
747 if ($fixedStyle > 0) {
748 $st = new ilNonEditableValueGUI($this->lng->txt("cont_current_style"));
749 $st->setValue(
750 ilObject::_lookupTitle($fixedStyle) . " (" . $this->lng->txt("global_fixed") . ")"
751 );
752 $form->addItem($st);
753 } else {
755 true,
756 false,
757 (int) $_GET["ref_id"]
758 );
759
760 if ($defaultStyle > 0) {
761 $st_styles[0] = ilObject::_lookupTitle($defaultStyle) . ' (' . $this->lng->txt('default') . ')';
762 } else {
763 $st_styles[0] = $this->lng->txt('default');
764 }
765 ksort($st_styles);
766
767 if ($styleId > 0) {
768 if (!ilObjStyleSheet::_lookupStandard($styleId)) {
769 $st = new ilNonEditableValueGUI($this->lng->txt('cont_current_style'));
770 $st->setValue(ilObject::_lookupTitle($styleId));
771 $form->addItem($st);
772
773 $form->addCommandButton('editStyle', $this->lng->txt('cont_edit_style'));
774 $form->addCommandButton('deleteStyle', $this->lng->txt('cont_delete_style'));
775 }
776 }
777
778 if ($styleId <= 0 || ilObjStyleSheet::_lookupStandard($styleId)) {
779 $style_sel = new ilSelectInputGUI($this->lng->txt('cont_current_style'), 'style_id');
780 $style_sel->setOptions($st_styles);
781 $style_sel->setValue($styleId);
782 $form->addItem($style_sel);
783 $form->addCommandButton('saveStyleSettings', $this->lng->txt('save'));
784 $form->addCommandButton('createStyle', $this->lng->txt('sty_create_ind_style'));
785 }
786 }
787
788 $form->setTitle($this->lng->txt("cont_style"));
789 $form->setFormAction($this->ctrl->getFormAction($this));
790
791 return $form;
792 }
793
794 protected function createStyle() : void
795 {
796 $this->ctrl->redirectByClass('ilobjstylesheetgui', 'create');
797 }
798
799 protected function editStyle() : void
800 {
801 $this->ctrl->redirectByClass('ilobjstylesheetgui', 'edit');
802 }
803
804 protected function deleteStyle() : void
805 {
806 $this->ctrl->redirectByClass('ilobjstylesheetgui', 'delete');
807 }
808
812 protected function saveStyleSettings() : void
813 {
814 $this->checkPermission('write');
815
816 if (
817 $this->settings->get('fixed_content_style_id') <= 0 &&
818 (
820 $this->object->getStyleSheetId()
821 ) ||
822 $this->object->getStyleSheetId() == 0
823 )
824 ) {
825 $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST['style_id']));
826 $this->object->update();
827 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
828 }
829
830 $this->ctrl->redirect($this, self::UI_CMD_STYLES_EDIT);
831 }
832}
user()
Definition: user.php:4
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
const PRESENTATION_MODE_PRESENTATION
presentation mode for requesting
Export User Interface Class.
This class represents a section header in a property form.
Class ilInfoScreenGUI.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
This class represents a non editable value in a property form.
Class ilObjContentPageGUI @ilCtrl_isCalledBy ilObjContentPageGUI: ilRepositoryGUI @ilCtrl_isCalledBy ...
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
static _goto(string $target)
addLocatorItems()
Functions to be overwritten.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
setSettingsSubTabs(string $activeTab)
Sub tab configuration of the settings area.
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
setTitleAndDescription()
called by prepare output
getType()
Functions that must be overwritten.
setTabs()
create tabs (repository/workspace switch)this had to be moved here because of the context-specific pe...
view()
Shows the content of the object.
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
getContent(string $ctrlLink='')
Class ilObjContentPage.
Class ilObjStyleSheetGUI.
static _lookupStandard($a_id)
Lookup standard flag.
static getSyntaxStylePath()
get syntax style path
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
New implementation of ilObjectGUI.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
setLocator()
set Locator
GUI class for the workflow of copying objects.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
addHeaderAction()
Add header action menu.
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 _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
getDescription()
get object description
getTitle()
get object title @access public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
getItemByPostVar($a_post_var)
Get Item by POST variable.
This class represents a selection list property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const ROOT_FOLDER_ID
Definition: constants.php:30
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
Interface ilContentPageObjectConstants.
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6
settings()
Definition: settings.php:2
$refId
Definition: xapitoken.php:40