19 declare(strict_types=1);
57 public function __construct(
int $a_id = 0,
int $a_id_type = self::REPOSITORY_NODE_ID,
int $a_parent_node_id = 0)
64 $this->
http = $this->dic->http();
65 $this->
settings = $this->dic->settings();
66 $this->navHistory = $this->dic[
'ilNavigationHistory'];
67 $this->
help = $DIC[
'ilHelp'];
68 $this->uiServices = $DIC->ui();
70 $this->
lng->loadLanguageModule(
'copa');
71 $this->
lng->loadLanguageModule(
'style');
72 $this->
lng->loadLanguageModule(
'content');
73 $this->
lng->loadLanguageModule(
'rep');
87 $cs = $DIC->contentStyle();
88 $this->content_style_gui = $cs->gui();
89 if (is_object($this->
object)) {
90 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
93 $this->in_page_editor_style_context = $this->
http->wrapper()->query()->has(
94 self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT
96 $this->
ctrl->saveParameterByClass(ilObjectContentStyleSettingsGUI::class, self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT);
99 public static function _goto(
string $target): void
102 $main_tpl = $DIC->ui()->mainTemplate();
104 $targetAttributes = explode(
'_', $target);
108 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
111 if ($DIC->access()->checkAccess(
'read',
'',
$refId)) {
112 $DIC->ctrl()->setTargetScript(
'ilias.php');
113 $DIC->ctrl()->setParameterByClass(self::class,
'ref_id',
$refId);
114 $DIC->ctrl()->redirectByClass([
115 ilRepositoryGUI::class,
117 ], self::UI_CMD_VIEW);
118 } elseif ($DIC->access()->checkAccess(
'visible',
'',
$refId)) {
120 } elseif ($DIC->access()->checkAccess(
'read',
'',
ROOT_FOLDER_ID)) {
121 $main_tpl->setOnScreenMessage(
'info', sprintf(
122 $DIC->language()->txt(
'msg_no_perm_read_item'),
126 $DIC->ctrl()->setTargetScript(
'ilias.php');
127 $DIC->ctrl()->setParameterByClass(ilRepositoryGUI::class,
'ref_id',
ROOT_FOLDER_ID);
128 $DIC->ctrl()->redirectByClass(ilRepositoryGUI::class);
131 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
136 return self::OBJ_TYPE;
141 if ($this->in_page_editor_style_context) {
145 $this->
help->setScreenIdComponent($this->
object->getType());
148 $this->tabs_gui->addTab(
149 self::UI_TAB_ID_CONTENT,
150 $this->
lng->txt(
'content'),
151 $this->
ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
156 $this->tabs_gui->addTab(
157 self::UI_TAB_ID_INFO,
158 $this->
lng->txt(
'info_short'),
159 $this->
ctrl->getLinkTargetByClass(ilInfoScreenGUI::class,
'showSummary')
164 $this->tabs_gui->addTab(
165 self::UI_TAB_ID_SETTINGS,
166 $this->
lng->txt(
'settings'),
167 $this->
ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
172 $this->tabs_gui->addTab(
174 $this->
lng->txt(
'learning_progress'),
175 $this->
ctrl->getLinkTargetByClass(ilLearningProgressGUI::class)
180 $this->tabs_gui->addTab(
182 $this->
lng->txt(
'meta_data'),
183 $this->
ctrl->getLinkTargetByClass(ilMDEditorGUI::class)
188 $this->tabs_gui->addTab(
189 self::UI_TAB_ID_EXPORT,
190 $this->
lng->txt(
'export'),
191 $this->
ctrl->getLinkTargetByClass(ilExportGUI::class)
196 $this->tabs_gui->addTab(
197 self::UI_TAB_ID_PERMISSIONS,
198 $this->
lng->txt(
'perm_settings'),
199 $this->
ctrl->getLinkTargetByClass(ilPermissionGUI::class,
'perm')
206 $nextClass = $this->
ctrl->getNextClass($this);
207 $cmd = $this->
ctrl->getCmd(self::UI_CMD_VIEW);
211 if (!$this->in_page_editor_style_context &&
212 strtolower($nextClass) !== strtolower(ilObjectContentStyleSettingsGUI::class) &&
213 (strtolower($cmd) !== strtolower(self::UI_CMD_EDIT) || strtolower($nextClass) !== strtolower(
214 ilContentPagePageGUI::class
219 switch (strtolower($nextClass)) {
220 case strtolower(ilObjectTranslationGUI::class):
224 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
228 $this->
ctrl->forwardCommand($transgui);
231 case strtolower(ilObjectContentStyleSettingsGUI::class):
235 if ($this->in_page_editor_style_context) {
236 $this->tabs_gui->setBackTarget(
237 $this->
lng->txt(
'back'),
241 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
245 $settings_gui = $this->content_style_gui
246 ->objectSettingsGUIForRefId(
250 $this->
ctrl->forwardCommand($settings_gui);
253 case strtolower(ilContentPagePageGUI::class):
254 $isMediaRequest = in_array(strtolower($cmd), array_map(
'strtolower', [
255 self::UI_CMD_COPAGE_DOWNLOAD_FILE,
256 self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN,
257 self::UI_CMD_COPAGE_DISPLAY_MEDIA,
258 self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH,
260 if ($isMediaRequest) {
262 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
265 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
270 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
271 $this->tpl->setCurrentBlock(
'SyntaxStyle');
273 $this->tpl->parseCurrentBlock();
285 $this->content_style_domain
287 $forwarder->setIsMediaRequest($isMediaRequest);
290 $this->pageMetricsService->store(
293 $event->
page()->getLanguage()
298 $pageContent = $forwarder->forward();
299 if ($pageContent !==
'') {
300 $this->tpl->setContent($pageContent);
304 case strtolower(ilInfoScreenGUI::class):
305 if (!$this->infoScreenEnabled) {
313 case strtolower(ilCommonActionDispatcherGUI::class):
318 case strtolower(ilPermissionGUI::class):
322 $this->tabs_gui->activateTab(self::UI_TAB_ID_PERMISSIONS);
327 case strtolower(ilMDEditorGUI::class):
331 $this->tabs_gui->activateTab(self::UI_TAB_ID_MD);
335 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
336 $this->
ctrl->forwardCommand($md_gui);
339 case strtolower(ilLearningProgressGUI::class):
341 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
345 $this->tabs_gui->activateTab(self::UI_TAB_ID_LP);
348 if ($this->
http->wrapper()->query()->has(
'user_id')) {
349 $usr_id = $this->
http->wrapper()->query()->retrieve(
357 $this->
object->getRefId(),
358 $usr_id === 0 ? $this->
user->getId() : $usr_id
362 case strtolower(ilExportGUI::class):
366 $this->tabs_gui->activateTab(self::UI_TAB_ID_EXPORT);
369 $gui->addFormat(
'xml');
370 $this->
ctrl->forwardCommand($gui);
373 case strtolower(ilObjectCopyGUI::class):
374 $this->tpl->loadStandardTemplate();
377 $gui->setType(self::OBJ_TYPE);
379 $this->
ctrl->forwardCommand($gui);
383 $settingsCommands = array_map(
'strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE]);
385 case in_array(strtolower($cmd), $settingsCommands,
true):
390 parent::executeCommand();
407 $this->navHistory->addItem(
408 $this->
object->getRefId(),
409 ilLink::_getLink($this->
object->getRefId(), $this->
object->getType()),
424 if (!$this->infoScreenEnabled) {
429 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
432 $this->tabs_gui->activateTab(self::UI_TAB_ID_INFO);
435 $info->enableLearningProgress();
436 $info->enablePrivateNotes();
437 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
439 $this->
ctrl->forwardCommand($info);
445 $this->tabs_gui->addSubTab(
446 self::UI_TAB_ID_SETTINGS,
447 $this->
lng->txt(
'settings'),
448 $this->
ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
451 $this->tabs_gui->addSubTab(
452 self::UI_TAB_ID_STYLE,
453 $this->
lng->txt(
'cont_style'),
454 $this->
ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
457 $this->tabs_gui->addSubTab(
458 self::UI_TAB_ID_I18N,
459 $this->
lng->txt(
'obj_multilinguality'),
460 $this->
ctrl->getLinkTargetByClass(ilObjectTranslationGUI::class)
463 $this->tabs_gui->activateSubTab($activeTab);
469 if ($this->
object instanceof
ilObject) {
471 $this->
object->getTitle(),
472 $this->
ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
474 $this->
object->getRefId()
481 $this->
ctrl->setCmd(
'showSummary');
482 $this->
ctrl->setCmdClass(ilInfoScreenGUI::class);
493 $this->tabs_gui->activateTab(self::UI_TAB_ID_CONTENT);
495 $this->tpl->setPermanentLink($this->
object->getType(), $this->
object->getRefId(),
'',
'_top');
503 $this->
lng->loadLanguageModule(
'cntr');
505 $this->uiServices->factory()->button()->primary(
506 $this->
lng->txt(
'cntr_text_media_editor'),
507 $this->
ctrl->getLinkTargetByClass(ilContentPagePageGUI::class,
'edit')
520 $this->
object->trackProgress($this->
user->getId());
532 $this->content_style_domain
536 return $forwarder->forward($ctrlLink);
544 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
545 $this->tpl->setCurrentBlock(
'SyntaxStyle');
547 $this->tpl->parseCurrentBlock();
552 $new_object->getObjectTranslation()->addLanguage(
553 $this->
lng->getDefaultLanguage(),
559 $new_object->getObjectTranslation()->save();
561 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
562 $this->
ctrl->redirect($this,
'edit');
567 parent::setTitleAndDescription();
570 $this->tpl->setTitleIcon($icon, $this->
lng->txt(
'obj_' . $this->object->getType()));
578 $presentationHeader->setTitle($this->
lng->txt(
'settings_presentation_header'));
579 $a_form->
addItem($presentationHeader);
581 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addIcon();
582 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
585 $sh->setTitle($this->
lng->txt(
'obj_features'));
596 if ($this->
getCreationMode() !==
true && count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
603 $this->
lng->txt(
'language'),
604 $languages[$this->
object->getObjectTranslation()->getDefaultLanguage()]
614 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
618 $online->setInfo($this->
lng->txt(
'copa_activation_online_info'));
624 $a_values[
'activation_online'] = $this->
object->getOfflineStatus() ===
false;
627 if (count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
628 $a_values[
'title'] = $this->
object->getObjectTranslation()->getDefaultTitle();
629 $a_values[
'desc'] = $this->
object->getObjectTranslation()->getDefaultDescription();
635 $this->
object->setOfflineStatus(!(
bool) $form->
getInput(
'activation_online'));
636 $this->
object->update();
645 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveIcon();
646 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
651 $this->content_style_gui->redirectToObjectSettings();
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
Interface GlobalHttpState.
ILIAS DI UIServices $uiServices
getContent(string $ctrlLink='')
executeCommand()
execute command
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
updateCustom(ilPropertyFormGUI $form)
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
PageMetricsService $pageMetricsService
Class ilObjContentPageGUI ilObjContentPageGUI: ilRepositoryGUI ilObjContentPageGUI: ilAdministratio...
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
Customizing of pimple-DIC for ILIAS.
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
static _lookupObjId(int $ref_id)
Export User Interface Class.
static http()
Fetches the global http state from ILIAS.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
static _lookupTitle(int $obj_id)
getEditFormCustomValues(array &$a_values)
ILIAS Style Content GUIService $content_style_gui
readonly bool $in_page_editor_style_context
static getSyntaxStylePath()
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
Last visited history for repository items.
addObserver(object $a_class, string $a_method, string $a_element)
ILIAS Style Content Object ObjectFacade $content_style_domain
afterSave(ilObject $new_object)
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
const LP_CONTEXT_REPOSITORY
readonly ilNavigationHistory $navHistory
const INFO_TAB_VISIBILITY
addAvailabilitySection(ilPropertyFormGUI $form)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _goto(string $target)
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setSettingsSubTabs(string $activeTab)
initEditCustomForm(ilPropertyFormGUI $a_form)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
final const PRESENTATION_MODE_PRESENTATION
presentation mode for requesting
GUI class for object translation handling.