19 declare(strict_types=1);
60 public function __construct(
int $a_id = 0,
int $a_id_type = self::REPOSITORY_NODE_ID,
int $a_parent_node_id = 0)
67 $this->
settings = $this->dic->settings();
68 $this->navHistory = $this->dic[
'ilNavigationHistory'];
69 $this->
help = $DIC[
'ilHelp'];
70 $this->uiServices = $DIC->ui();
71 $this->lom_services = $DIC->learningObjectMetadata();
73 $this->
lng->loadLanguageModule(
'copa');
74 $this->
lng->loadLanguageModule(
'style');
75 $this->
lng->loadLanguageModule(
'content');
76 $this->
lng->loadLanguageModule(
'rep');
90 $cs = $DIC->contentStyle();
91 $this->content_style_gui = $cs->gui();
92 if (is_object($this->
object)) {
93 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
94 $this->translation = $this->
object->getObjectProperties()->getPropertyTranslations();
97 $this->in_page_editor_style_context = $this->
http->wrapper()->query()->has(
98 self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT
100 $this->
ctrl->saveParameterByClass(
101 ilObjectContentStyleSettingsGUI::class,
102 self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT
106 public static function _goto(
string $target): void
109 $main_tpl = $DIC->ui()->mainTemplate();
111 $targetAttributes = explode(
'_', $target);
115 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
118 if ($DIC->access()->checkAccess(
'read',
'',
$refId)) {
119 $DIC->ctrl()->setTargetScript(
'ilias.php');
120 $DIC->ctrl()->setParameterByClass(self::class,
'ref_id',
$refId);
121 $DIC->ctrl()->redirectByClass([
122 ilRepositoryGUI::class,
124 ], self::UI_CMD_VIEW);
125 } elseif ($DIC->access()->checkAccess(
'visible',
'',
$refId)) {
127 } elseif ($DIC->access()->checkAccess(
'read',
'',
ROOT_FOLDER_ID)) {
128 $main_tpl->setOnScreenMessage(
131 $DIC->language()->txt(
'msg_no_perm_read_item'),
137 $DIC->ctrl()->setTargetScript(
'ilias.php');
138 $DIC->ctrl()->setParameterByClass(ilRepositoryGUI::class,
'ref_id',
ROOT_FOLDER_ID);
139 $DIC->ctrl()->redirectByClass(ilRepositoryGUI::class);
142 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
147 return self::OBJ_TYPE;
152 if ($this->in_page_editor_style_context) {
156 $this->
help->setScreenIdComponent($this->
object->getType());
159 $this->tabs_gui->addTab(
160 self::UI_TAB_ID_CONTENT,
161 $this->
lng->txt(
'content'),
162 $this->
ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
167 $this->tabs_gui->addTab(
168 self::UI_TAB_ID_INFO,
169 $this->
lng->txt(
'info_short'),
170 $this->
ctrl->getLinkTargetByClass(ilInfoScreenGUI::class,
'showSummary')
175 $this->tabs_gui->addTab(
176 self::UI_TAB_ID_SETTINGS,
177 $this->
lng->txt(
'settings'),
178 $this->
ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
183 $this->tabs_gui->addTab(
185 $this->
lng->txt(
'learning_progress'),
186 $this->
ctrl->getLinkTargetByClass(ilLearningProgressGUI::class)
191 $this->tabs_gui->addTab(
193 $this->
lng->txt(
'meta_data'),
194 $this->
ctrl->getLinkTargetByClass(ilMDEditorGUI::class)
199 $this->tabs_gui->addTab(
200 self::UI_TAB_ID_EXPORT,
201 $this->
lng->txt(
'export'),
202 $this->
ctrl->getLinkTargetByClass(ilExportGUI::class)
207 $this->tabs_gui->addTab(
208 self::UI_TAB_ID_PERMISSIONS,
209 $this->
lng->txt(
'perm_settings'),
210 $this->
ctrl->getLinkTargetByClass(ilPermissionGUI::class,
'perm')
217 $nextClass = $this->
ctrl->getNextClass($this) ??
'';
218 $cmd = $this->
ctrl->getCmd(self::UI_CMD_VIEW) ??
'';
222 if (!$this->in_page_editor_style_context &&
223 strtolower($nextClass) !== strtolower(ilObjectContentStyleSettingsGUI::class) &&
224 (strtolower($cmd) !== strtolower(self::UI_CMD_EDIT) || strtolower($nextClass) !== strtolower(
225 ilContentPagePageGUI::class
230 switch (strtolower($nextClass)) {
231 case strtolower(TranslationGUI::class):
235 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
251 $this->
ctrl->forwardCommand($transgui);
254 case strtolower(ilObjectContentStyleSettingsGUI::class):
258 if ($this->in_page_editor_style_context) {
259 $this->tabs_gui->setBackTarget(
260 $this->
lng->txt(
'back'),
264 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
268 $settings_gui = $this->content_style_gui
269 ->objectSettingsGUIForRefId(
273 $this->
ctrl->forwardCommand($settings_gui);
276 case strtolower(ilContentPagePageGUI::class):
277 $isMediaRequest = in_array(
280 self::UI_CMD_COPAGE_DOWNLOAD_FILE,
281 self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN,
282 self::UI_CMD_COPAGE_DISPLAY_MEDIA,
283 self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH,
287 if ($isMediaRequest) {
289 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
292 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
297 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
298 $this->tpl->setCurrentBlock(
'SyntaxStyle');
300 $this->tpl->parseCurrentBlock();
313 $this->content_style_domain
315 $forwarder->setIsMediaRequest($isMediaRequest);
318 $this->pageMetricsService->store(
321 $event->
page()->getLanguage()
326 $pageContent = $forwarder->forward();
327 if ($pageContent !==
'') {
328 $this->tpl->setContent($pageContent);
332 case strtolower(ilInfoScreenGUI::class):
333 if (!$this->infoScreenEnabled) {
341 case strtolower(ilCommonActionDispatcherGUI::class):
346 case strtolower(ilPermissionGUI::class):
350 $this->tabs_gui->activateTab(self::UI_TAB_ID_PERMISSIONS);
355 case strtolower(ilMDEditorGUI::class):
359 $this->tabs_gui->activateTab(self::UI_TAB_ID_MD);
362 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
363 $this->
ctrl->forwardCommand($md_gui);
366 case strtolower(ilLearningProgressGUI::class):
368 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
372 $this->tabs_gui->activateTab(self::UI_TAB_ID_LP);
375 if ($this->
http->wrapper()->query()->has(
'user_id')) {
376 $usr_id = $this->
http->wrapper()->query()->retrieve(
382 $this->
ctrl->forwardCommand(
385 $this->
object->getRefId(),
386 $usr_id === 0 ? $this->
user->getId() : $usr_id
391 case strtolower(ilExportGUI::class):
395 $this->tabs_gui->activateTab(self::UI_TAB_ID_EXPORT);
398 $this->
ctrl->forwardCommand($gui);
401 case strtolower(ilObjectCopyGUI::class):
402 $this->tpl->loadStandardTemplate();
405 $gui->setType(self::OBJ_TYPE);
407 $this->
ctrl->forwardCommand($gui);
411 $settingsCommands =
array_map(
'strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE]);
413 case in_array(strtolower($cmd), $settingsCommands,
true):
418 parent::executeCommand();
435 $this->navHistory->addItem(
436 $this->
object->getRefId(),
437 ilLink::_getLink($this->
object->getRefId(), $this->
object->getType()),
452 if (!$this->infoScreenEnabled) {
457 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
460 if (strtolower($this->
ctrl->getCmd() ??
'') ===
'infoscreen') {
461 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
'showSummary');
464 $this->tabs_gui->activateTab(self::UI_TAB_ID_INFO);
467 $info->enableLearningProgress();
468 $info->enablePrivateNotes();
469 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
477 $this->tabs_gui->addSubTab(
478 self::UI_TAB_ID_SETTINGS,
479 $this->
lng->txt(
'general'),
480 $this->
ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
483 $this->tabs_gui->addSubTab(
484 self::UI_TAB_ID_STYLE,
485 $this->
lng->txt(
'cont_style'),
486 $this->
ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
489 $this->tabs_gui->addSubTab(
490 self::UI_TAB_ID_I18N,
491 $this->
lng->txt(
'obj_multilinguality'),
492 $this->
ctrl->getLinkTargetByClass(TranslationGUI::class)
495 $this->tabs_gui->activateSubTab($activeTab);
501 if ($this->
object instanceof
ilObject) {
503 $this->
object->getTitle(),
504 $this->
ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
506 $this->
object->getRefId()
522 $this->tabs_gui->activateTab(self::UI_TAB_ID_CONTENT);
524 $this->tpl->setPermanentLink($this->
object->getType(), $this->
object->getRefId(),
'',
'_top');
532 $this->
lng->loadLanguageModule(
'cntr');
534 $this->uiServices->factory()->button()->primary(
535 $this->
lng->txt(
'cntr_text_media_editor'),
536 $this->
ctrl->getLinkTargetByClass(ilContentPagePageGUI::class,
'edit')
549 $this->
object->trackProgress($this->
user->getId());
562 $this->content_style_domain
566 return $forwarder->forward($ctrlLink);
574 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
575 $this->tpl->setCurrentBlock(
'SyntaxStyle');
577 $this->tpl->parseCurrentBlock();
583 $new_object->getObjectTranslation()->withLanguage(
585 $this->
lng->getDefaultLanguage(),
593 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
594 $this->
ctrl->redirect($this,
'edit');
599 parent::setTitleAndDescription();
602 $this->tpl->setTitleIcon($icon, $this->
lng->txt(
'obj_' . $this->object->getType()));
610 $presentationHeader->setTitle($this->
lng->txt(
'settings_presentation_header'));
611 $a_form->
addItem($presentationHeader);
613 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addIcon();
614 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
617 $sh->setTitle($this->
lng->txt(
'obj_features'));
628 if ($this->
getCreationMode() !==
true && count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
630 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $lom_lang) {
631 if ($lom_lang->value() === $this->
object->getObjectTranslation()->getDefaultLanguage()) {
632 $language = $lom_lang->presentableLabel();
640 $this->
lng->txt(
'language'),
651 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
655 $online->setInfo($this->
lng->txt(
'copa_activation_online_info'));
661 if (count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
662 $a_values[
'title'] = $this->
object->getObjectTranslation()->getDefaultTitle();
663 $a_values[
'desc'] = $this->
object->getObjectTranslation()->getDefaultDescription();
666 $a_values[
'activation_online'] = $this->
object->getOfflineStatus() ===
false;
672 $this->
object->setOfflineStatus(!(
bool) $form->
getInput(
'activation_online'));
673 $this->
object->update();
682 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveIcon();
683 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
688 $this->content_style_gui->redirectToObjectSettings();
getContent(string $ctrlLink='')
readonly LOMServices $lom_services
readonly ILIAS Style Content GUIService $content_style_gui
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)
GUI class for object translation handling.
Class handles translation mode for an object.
External facade for object content styles.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
ilObjContentPageGUI: ilRepositoryGUI ilObjContentPageGUI: ilAdministrationGUI ilObjContentPageGUI: ...
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 _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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)
readonly Translations $translation
getEditFormCustomValues(array &$a_values)
readonly PageMetricsService $pageMetricsService
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)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
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)
__construct(Container $dic, ilPlugin $plugin)
const LP_CONTEXT_REPOSITORY
readonly ilNavigationHistory $navHistory
const INFO_TAB_VISIBILITY
addAvailabilitySection(ilPropertyFormGUI $form)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
readonly ILIAS DI UIServices $uiServices
static _goto(string $target)
addHeaderAction()
Add header action menu.
final const string PRESENTATION_MODE_PRESENTATION
presentation mode for requesting
Class ilObjUserTrackingGUI.
setSettingsSubTabs(string $activeTab)
initEditCustomForm(ilPropertyFormGUI $a_form)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...