19declare(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)) {
128 $main_tpl->setOnScreenMessage(
131 $DIC->language()->txt(
'msg_no_perm_read_item'),
137 $DIC->ctrl()->setTargetScript(
'ilias.php');
139 $DIC->ctrl()->redirectByClass(ilRepositoryGUI::class);
142 $DIC[
'ilErr']->raiseError(
$DIC->language()->txt(
'msg_no_perm_read'),
$DIC[
'ilErr']->FATAL);
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 switch (strtolower($nextClass)) {
223 case strtolower(TranslationGUI::class):
227 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
243 $this->
ctrl->forwardCommand($transgui);
246 case strtolower(ilObjectContentStyleSettingsGUI::class):
250 if ($this->in_page_editor_style_context) {
251 $this->tabs_gui->setBackTarget(
252 $this->
lng->txt(
'back'),
256 $this->tabs_gui->activateTab(self::UI_TAB_ID_SETTINGS);
260 $settings_gui = $this->content_style_gui
261 ->objectSettingsGUIForRefId(
265 $this->
ctrl->forwardCommand($settings_gui);
268 case strtolower(ilContentPagePageGUI::class):
269 $isMediaRequest = in_array(
271 array_map(
'strtolower', [
279 if ($isMediaRequest) {
281 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
284 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
289 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
290 $this->tpl->setCurrentBlock(
'SyntaxStyle');
292 $this->tpl->parseCurrentBlock();
305 $this->content_style_domain
307 $forwarder->setIsMediaRequest($isMediaRequest);
310 $this->pageMetricsService->store(
313 $event->
page()->getLanguage()
318 $pageContent = $forwarder->forward();
319 if ($pageContent !==
'') {
320 $this->tpl->setContent($pageContent);
324 case strtolower(ilInfoScreenGUI::class):
325 if (!$this->infoScreenEnabled) {
333 case strtolower(ilCommonActionDispatcherGUI::class):
338 case strtolower(ilPermissionGUI::class):
342 $this->tabs_gui->activateTab(self::UI_TAB_ID_PERMISSIONS);
347 case strtolower(ilMDEditorGUI::class):
351 $this->tabs_gui->activateTab(self::UI_TAB_ID_MD);
354 $md_gui->addObserver($this->
object,
'MDUpdateListener',
'General');
355 $this->
ctrl->forwardCommand($md_gui);
358 case strtolower(ilLearningProgressGUI::class):
360 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
364 $this->tabs_gui->activateTab(self::UI_TAB_ID_LP);
367 if ($this->
http->wrapper()->query()->has(
'user_id')) {
368 $usr_id = $this->
http->wrapper()->query()->retrieve(
374 $this->
ctrl->forwardCommand(
377 $this->
object->getRefId(),
378 $usr_id === 0 ? $this->user->getId() : $usr_id
383 case strtolower(ilExportGUI::class):
387 $this->tabs_gui->activateTab(self::UI_TAB_ID_EXPORT);
390 $this->
ctrl->forwardCommand($gui);
393 case strtolower(ilObjectCopyGUI::class):
394 $this->tpl->loadStandardTemplate();
397 $gui->setType(self::OBJ_TYPE);
399 $this->
ctrl->forwardCommand($gui);
403 $settingsCommands = array_map(
'strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE]);
405 case in_array(strtolower($cmd), $settingsCommands,
true):
410 parent::executeCommand();
413 if (!$this->in_page_editor_style_context &&
414 strtolower($nextClass) !== strtolower(ilObjectContentStyleSettingsGUI::class) &&
415 (strtolower($cmd) !== strtolower(self::UI_CMD_EDIT) || strtolower($nextClass) !== strtolower(
416 ilContentPagePageGUI::class
436 $this->navHistory->addItem(
437 $this->
object->getRefId(),
438 ilLink::_getLink($this->object->getRefId(), $this->object->getType()),
439 $this->object->getType()
453 if (!$this->infoScreenEnabled) {
458 $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
461 if (strtolower($this->
ctrl->getCmd() ??
'') ===
'infoscreen') {
462 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
'showSummary');
465 $this->tabs_gui->activateTab(self::UI_TAB_ID_INFO);
468 $info->enableLearningProgress();
469 $info->enablePrivateNotes();
470 $info->addMetaDataSections($this->
object->getId(), 0, $this->object->getType());
478 $this->tabs_gui->addSubTab(
479 self::UI_TAB_ID_SETTINGS,
480 $this->
lng->txt(
'general'),
481 $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
484 $this->tabs_gui->addSubTab(
485 self::UI_TAB_ID_STYLE,
486 $this->
lng->txt(
'cont_style'),
487 $this->ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
490 $this->tabs_gui->addSubTab(
491 self::UI_TAB_ID_I18N,
492 $this->
lng->txt(
'obj_multilinguality'),
493 $this->ctrl->getLinkTargetByClass(TranslationGUI::class)
496 $this->tabs_gui->activateSubTab($activeTab);
502 if ($this->
object instanceof
ilObject) {
504 $this->
object->getTitle(),
505 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
507 $this->object->getRefId()
523 $this->tabs_gui->activateTab(self::UI_TAB_ID_CONTENT);
525 $this->tpl->setPermanentLink($this->
object->getType(), $this->object->getRefId(),
'',
'_top');
532 if (!$this->
user->isAnonymous() && $this->checkPermissionBool(
'write')) {
533 $this->
lng->loadLanguageModule(
'cntr');
535 $this->uiServices->factory()->button()->primary(
536 $this->lng->txt(
'cntr_text_media_editor'),
537 $this->ctrl->getLinkTargetByClass(ilContentPagePageGUI::class,
'edit')
550 $this->
object->trackProgress($this->
user->getId());
563 $this->content_style_domain
567 return $forwarder->forward($ctrlLink);
575 $this->content_style_gui->addCss($this->tpl, $this->
object->getRefId());
576 $this->tpl->setCurrentBlock(
'SyntaxStyle');
578 $this->tpl->parseCurrentBlock();
584 $new_object->getObjectTranslation()->withLanguage(
586 $this->
lng->getDefaultLanguage(),
594 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'object_added'),
true);
595 $this->
ctrl->redirect($this,
'edit');
600 parent::setTitleAndDescription();
603 $this->tpl->setTitleIcon($icon, $this->
lng->txt(
'obj_' . $this->object->getType()));
611 $presentationHeader->setTitle($this->
lng->txt(
'settings_presentation_header'));
612 $a_form->
addItem($presentationHeader);
614 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addIcon();
615 $this->object_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
618 $sh->setTitle($this->
lng->txt(
'obj_features'));
629 if ($this->
getCreationMode() !==
true && count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
631 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $lom_lang) {
632 if ($lom_lang->value() === $this->object->getObjectTranslation()->getDefaultLanguage()) {
633 $language = $lom_lang->presentableLabel();
641 $this->
lng->txt(
'language'),
652 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
656 $online->setInfo($this->
lng->txt(
'copa_activation_online_info'));
662 if (count($this->
object->getObjectTranslation()->getLanguages()) > 1) {
663 $a_values[
'title'] = $this->
object->getObjectTranslation()->getDefaultTitle();
664 $a_values[
'desc'] = $this->
object->getObjectTranslation()->getDefaultDescription();
667 $a_values[
'activation_online'] = $this->
object->getOfflineStatus() ===
false;
673 $this->
object->setOfflineStatus(!(
bool) $form->
getInput(
'activation_online'));
674 $this->
object->update();
683 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveIcon();
684 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
689 $this->content_style_gui->redirectToObjectSettings();
Customizing of pimple-DIC for ILIAS.
GUI class for object translation handling.
Class handles translation mode for an object.
External facade for object content styles.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
final const string PRESENTATION_MODE_PRESENTATION
presentation mode for requesting
@ilCtrl_Calls ilContentPagePageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI @ilCtrl_Calls ...
Export User Interface Class.
Learning progress access checks.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
Last visited history for repository items.
@ilCtrl_isCalledBy ilObjContentPageGUI: ilRepositoryGUI @ilCtrl_isCalledBy ilObjContentPageGUI: ilAdm...
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
static _goto(string $target)
addLocatorItems()
Functions to be overwritten.
setSettingsSubTabs(string $activeTab)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
ILIAS Style Content Object ObjectFacade $content_style_domain
afterSave(ilObject $new_object)
Post (successful) object creation hook.
getType()
Functions that must be overwritten.
setTabs()
create tabs (repository/workspace switch)
view()
view object content (repository/workspace switch)
readonly ILIAS Style Content GUIService $content_style_gui
readonly ilNavigationHistory $navHistory
readonly ILIAS DI UIServices $uiServices
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
addAvailabilitySection(ilPropertyFormGUI $form)
readonly Translations $translation
readonly PageMetricsService $pageMetricsService
readonly LOMServices $lom_services
getContent(string $ctrlLink='')
readonly bool $in_page_editor_style_context
static getSyntaxStylePath()
New implementation of ilObjectGUI.
executeCommand()
execute command
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
GUI class for the workflow of copying objects.
addHeaderAction()
Add header action menu.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
const INFO_TAB_VISIBILITY
Class ilObject Basic functions for all objects.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
Interface ilContentPageObjectConstants.
const UI_CMD_COPAGE_DISPLAY_FULLSCREEN
const UI_CMD_COPAGE_DOWNLOAD_FILE
const UI_CMD_COPAGE_DISPLAY_MEDIA
const UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))