19 declare(strict_types=1);
56 public function __construct(
int $a_id = 0,
int $a_id_type = self::REPOSITORY_NODE_ID,
int $a_parent_node_id = 0)
63 $this->
http = $this->dic->http();
64 $this->
settings = $this->dic->settings();
65 $this->navHistory = $this->dic[
'ilNavigationHistory'];
66 $this->
help = $DIC[
'ilHelp'];
67 $this->uiServices = $DIC->ui();
69 $this->
lng->loadLanguageModule(
'copa');
70 $this->
lng->loadLanguageModule(
'style');
71 $this->
lng->loadLanguageModule(
'content');
72 $this->
lng->loadLanguageModule(
'rep');
86 $cs = $DIC->contentStyle();
87 $this->content_style_gui = $cs->gui();
88 if (is_object($this->
object)) {
89 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
92 $this->in_page_editor_style_context = $this->
http->wrapper()->query()->has(
93 self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT
95 $this->
ctrl->saveParameterByClass(ilObjectContentStyleSettingsGUI::class, self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT);
98 public static function _goto(
string $target): void
101 $main_tpl = $DIC->ui()->mainTemplate();
103 $targetAttributes = explode(
'_', $target);
107 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
110 if ($DIC->access()->checkAccess(
'read',
'',
$refId)) {
111 $DIC->ctrl()->setTargetScript(
'ilias.php');
112 $DIC->ctrl()->setParameterByClass(self::class,
'ref_id',
$refId);
113 $DIC->ctrl()->redirectByClass([
114 ilRepositoryGUI::class,
116 ], self::UI_CMD_VIEW);
117 } elseif ($DIC->access()->checkAccess(
'visible',
'',
$refId)) {
119 } elseif ($DIC->access()->checkAccess(
'read',
'',
ROOT_FOLDER_ID)) {
120 $main_tpl->setOnScreenMessage(
'info', sprintf(
121 $DIC->language()->txt(
'msg_no_perm_read_item'),
125 $DIC->ctrl()->setTargetScript(
'ilias.php');
126 $DIC->ctrl()->setParameterByClass(ilRepositoryGUI::class,
'ref_id',
ROOT_FOLDER_ID);
127 $DIC->ctrl()->redirectByClass(ilRepositoryGUI::class);
130 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
135 return self::OBJ_TYPE;
140 if ($this->in_page_editor_style_context) {
144 $this->
help->setScreenIdComponent($this->
object->getType());
147 $this->tabs_gui->addTab(
148 self::UI_TAB_ID_CONTENT,
149 $this->
lng->txt(
'content'),
150 $this->
ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
155 $this->tabs_gui->addTab(
156 self::UI_TAB_ID_INFO,
157 $this->
lng->txt(
'info_short'),
158 $this->
ctrl->getLinkTargetByClass(ilInfoScreenGUI::class,
'showSummary')
163 $this->tabs_gui->addTab(
164 self::UI_TAB_ID_SETTINGS,
165 $this->
lng->txt(
'settings'),
166 $this->
ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
171 $this->tabs_gui->addTab(
173 $this->
lng->txt(
'learning_progress'),
174 $this->
ctrl->getLinkTargetByClass(ilLearningProgressGUI::class)
179 $this->tabs_gui->addTab(
180 self::UI_TAB_ID_EXPORT,
181 $this->
lng->txt(
'export'),
182 $this->
ctrl->getLinkTargetByClass(ilExportGUI::class)
187 $this->tabs_gui->addTab(
188 self::UI_TAB_ID_PERMISSIONS,
189 $this->
lng->txt(
'perm_settings'),
190 $this->
ctrl->getLinkTargetByClass(ilPermissionGUI::class,
'perm')
197 $nextClass = $this->
ctrl->getNextClass($this);
198 $cmd = $this->
ctrl->getCmd(self::UI_CMD_VIEW);
203 !$this->in_page_editor_style_context &&
204 strtolower($nextClass) !== strtolower(ilObjectContentStyleSettingsGUI::class) &&
205 (strtolower($cmd) !== strtolower(self::UI_CMD_EDIT) || strtolower($nextClass) !== strtolower(ilContentPagePageGUI::class))
210 switch (strtolower($nextClass)) {
211 case strtolower(ilObjectTranslationGUI::class):
215 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
219 $this->
ctrl->forwardCommand($transgui);
222 case strtolower(ilObjectContentStyleSettingsGUI::class):
226 if (!$this->in_page_editor_style_context) {
227 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
230 $settings_gui = $this->content_style_gui
231 ->objectSettingsGUIForRefId(
235 $this->
ctrl->forwardCommand($settings_gui);
238 case strtolower(ilContentPagePageGUI::class):
239 $isMediaRequest = in_array(strtolower($cmd), array_map(
'strtolower', [
240 self::UI_CMD_COPAGE_DOWNLOAD_FILE,
241 self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN,
242 self::UI_CMD_COPAGE_DISPLAY_MEDIA,
243 self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH,
245 if ($isMediaRequest) {
247 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
250 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
255 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
256 $this->tpl->setCurrentBlock(
'SyntaxStyle');
258 $this->tpl->parseCurrentBlock();
270 $this->content_style_domain
272 $forwarder->setIsMediaRequest($isMediaRequest);
275 $this->pageMetricsService->store(
278 $event->
page()->getLanguage()
283 $pageContent = $forwarder->forward();
284 if ($pageContent !==
'') {
285 $this->tpl->setContent($pageContent);
289 case strtolower(ilInfoScreenGUI::class):
290 if (!$this->infoScreenEnabled) {
298 case strtolower(ilCommonActionDispatcherGUI::class):
303 case strtolower(ilPermissionGUI::class):
307 $this->tabs_gui->activateTab(self::UI_TAB_ID_PERMISSIONS);
312 case strtolower(ilLearningProgressGUI::class):
314 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
318 $this->tabs_gui->activateTab(self::UI_TAB_ID_LP);
321 if ($this->
http->wrapper()->query()->has(
'user_id')) {
322 $usr_id = $this->
http->wrapper()->query()->retrieve(
330 $this->
object->getRefId(),
331 $usr_id === 0 ? $this->
user->getId() : $usr_id
335 case strtolower(ilExportGUI::class):
339 $this->tabs_gui->activateTab(self::UI_TAB_ID_EXPORT);
342 $gui->addFormat(
'xml');
343 $this->
ctrl->forwardCommand($gui);
346 case strtolower(ilObjectCopyGUI::class):
347 $this->tpl->loadStandardTemplate();
350 $gui->setType(self::OBJ_TYPE);
352 $this->
ctrl->forwardCommand($gui);
356 $settingsCommands = array_map(
'strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE]);
358 case in_array(strtolower($cmd), $settingsCommands,
true):
363 if (in_array(strtolower($cmd), array_map(
'strtolower', [
'addToDesk',
'removeFromDesk']),
true)) {
364 $this->
ctrl->setCmd($cmd .
'Object');
367 parent::executeCommand();
374 $this->navHistory->addItem(
375 $this->
object->getRefId(),
391 if (!$this->infoScreenEnabled) {
396 $this->error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
399 $this->tabs_gui->activateTab(self::UI_TAB_ID_INFO);
402 $info->enableLearningProgress();
403 $info->enablePrivateNotes();
404 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
406 $this->
ctrl->forwardCommand($info);
412 $this->tabs_gui->addSubTab(
413 self::UI_TAB_ID_SETTINGS,
414 $this->
lng->txt(
'settings'),
415 $this->
ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
418 $this->tabs_gui->addSubTab(
419 self::UI_TAB_ID_STYLE,
420 $this->
lng->txt(
'cont_style'),
421 $this->
ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
424 $this->tabs_gui->addSubTab(
425 self::UI_TAB_ID_I18N,
426 $this->
lng->txt(
'obj_multilinguality'),
427 $this->
ctrl->getLinkTargetByClass(ilObjectTranslationGUI::class)
430 $this->tabs_gui->activateSubTab($activeTab);
436 if ($this->
object instanceof
ilObject) {
438 $this->
object->getTitle(),
439 $this->
ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
441 $this->
object->getRefId()
448 $this->
ctrl->setCmd(
'showSummary');
449 $this->
ctrl->setCmdClass(ilInfoScreenGUI::class);
460 $this->tabs_gui->activateTab(self::UI_TAB_ID_CONTENT);
462 $this->tpl->setPermanentLink($this->
object->getType(), $this->
object->getRefId(),
'',
'_top');
470 $this->
lng->loadLanguageModule(
'cntr');
472 $this->uiServices->factory()->button()->primary(
473 $this->
lng->txt(
'cntr_text_media_editor'),
474 $this->
ctrl->getLinkTargetByClass(ilContentPagePageGUI::class,
'edit')
488 $this->
object->trackProgress($this->
user->getId());
500 $this->content_style_domain
504 return $forwarder->forward($ctrlLink);
512 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
513 $this->tpl->setCurrentBlock(
'SyntaxStyle');
515 $this->tpl->parseCurrentBlock();
520 $new_object->getObjectTranslation()->addLanguage(
521 $this->
lng->getDefaultLanguage(),
527 $new_object->getObjectTranslation()->save();
529 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
530 $this->
ctrl->redirect($this,
'edit');
535 parent::setTitleAndDescription();
538 $this->tpl->setTitleIcon($icon, $this->
lng->txt(
'obj_' . $this->object->getType()));
546 $presentationHeader->setTitle($this->
lng->txt(
'settings_presentation_header'));
547 $a_form->
addItem($presentationHeader);
549 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addIcon();
550 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
553 $sh->setTitle($this->
lng->txt(
'obj_features'));
564 if ($this->
getCreationMode() !==
true && count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
571 $this->
lng->txt(
'language'),
572 $languages[$this->
object->getObjectTranslation()->getDefaultLanguage()]
582 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
586 $online->
setInfo($this->
lng->txt(
'copa_activation_online_info'));
592 $a_values[
'activation_online'] = $this->
object->getOfflineStatus() ===
false;
595 if (count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
596 $a_values[
'title'] = $this->
object->getObjectTranslation()->getDefaultTitle();
597 $a_values[
'desc'] = $this->
object->getObjectTranslation()->getDefaultDescription();
603 $this->
object->setOfflineStatus(!(
bool) $form->
getInput(
'activation_online'));
604 $this->
object->update();
613 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveIcon();
614 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
619 $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.
ilNavigationHistory $navHistory
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
bool $in_page_editor_style_context
getEditFormCustomValues(array &$a_values)
ILIAS Style Content GUIService $content_style_gui
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
static getSyntaxStylePath()
const PRESENTATION_MODE_PRESENTATION
presentation mode for requesting
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
Navigation History of Repository Items.
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
const LP_CONTEXT_REPOSITORY
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...