81 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
88 $this->request = $this->dic->http()->request();
89 $this->
settings = $this->dic->settings();
90 $this->access = $this->dic->access();
91 $this->ctrl = $this->dic->ctrl();
92 $this->tabs = $this->dic->tabs();
93 $this->
user = $this->dic->user();
94 $this->obj_service = $this->dic->object();
95 $this->navHistory = $this->dic[
'ilNavigationHistory'];
96 $this->error = $this->dic[
'ilErr'];
97 $this->
help = $DIC[
'ilHelp'];
99 $this->lng->loadLanguageModule(
'copa');
100 $this->lng->loadLanguageModule(
'style');
101 $this->lng->loadLanguageModule(
'content');
105 $this->object->getId(),
116 public static function _goto($target)
120 $targetAttributes = explode(
'_', $target);
121 $refId = (int) $targetAttributes[0];
124 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
127 if ($DIC->access()->checkAccess(
'read',
'',
$refId)) {
128 $DIC->ctrl()->setTargetScript(
'ilias.php');
129 $DIC->ctrl()->initBaseClass(
'ilRepositoryGUI');
130 if (isset($DIC->http()->request()->getQueryParams()[
'gotolp'])) {
131 $DIC->ctrl()->setParameterByClass(__CLASS__,
'gotolp', 1);
133 $DIC->ctrl()->setParameterByClass(__CLASS__,
'ref_id',
$refId);
134 $DIC->ctrl()->redirectByClass(array(
137 ), self::UI_CMD_VIEW);
138 } elseif ($DIC->access()->checkAccess(
"visible",
"", $target)) {
140 } elseif ($DIC->access()->checkAccess(
'read',
'', ROOT_FOLDER_ID)) {
142 $DIC->language()->txt(
'msg_no_perm_read_item'),
146 $DIC->ctrl()->setTargetScript(
'ilias.php');
147 $DIC->ctrl()->initBaseClass(
'ilRepositoryGUI');
148 $DIC->ctrl()->setParameterByClass(
'ilRepositoryGUI',
'ref_id', ROOT_FOLDER_ID);
149 $DIC->ctrl()->redirectByClass(
'ilRepositoryGUI');
152 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
160 return self::OBJ_TYPE;
168 $this->
help->setScreenIdComponent($this->object->getType());
172 self::UI_TAB_ID_CONTENT,
173 $this->lng->txt(
'content'),
174 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
180 self::UI_TAB_ID_INFO,
181 $this->lng->txt(
'info_short'),
182 $this->ctrl->getLinkTargetByClass(
'ilinfoscreengui',
'showSummary')
188 self::UI_TAB_ID_SETTINGS,
189 $this->lng->txt(
'settings'),
190 $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
197 $this->lng->txt(
'learning_progress'),
198 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui')
204 self::UI_TAB_ID_EXPORT,
205 $this->lng->txt(
'export'),
206 $this->ctrl->getLinkTargetByClass(
'ilexportgui')
212 self::UI_TAB_ID_PERMISSIONS,
213 $this->lng->txt(
'perm_settings'),
214 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
'perm')
227 $nextClass = $this->ctrl->getNextClass($this);
228 $cmd = $this->ctrl->getCmd(self::UI_CMD_VIEW);
232 if (strtolower($nextClass) !==
'ilobjstylesheetgui') {
236 switch (strtolower($nextClass)) {
237 case 'ilobjstylesheetgui':
242 $this->ctrl->setReturn($this,
'editStyleProperties');
243 $style_gui = new \ilObjStyleSheetGUI(
245 $this->object->getStyleSheetId(),
249 $style_gui->omitLocator();
250 if ($cmd ===
'create' ||
$_GET[
'new_type'] ===
'sty') {
251 $style_gui->setCreationMode(
true);
254 if ($cmd ===
'confirmedDelete') {
255 $this->
object->setStyleSheetId(0);
256 $this->
object->update();
259 $ret = $this->ctrl->forwardCommand($style_gui);
261 if ($cmd ===
'save' || $cmd ===
'copyStyle' || $cmd ===
'importStyle') {
263 $this->
object->setStyleSheetId($styleId);
264 $this->
object->update();
265 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'edit');
269 case 'ilcontentpagepagegui':
270 if (in_array(strtolower($cmd), array_map(
'strtolower', [
271 self::UI_CMD_COPAGE_DOWNLOAD_FILE,
272 self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN,
273 self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH,
277 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
280 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
285 $this->tpl->setVariable(
286 'LOCATION_CONTENT_STYLESHEET',
289 $this->tpl->setCurrentBlock(
'SyntaxStyle');
291 $this->tpl->parseCurrentBlock();
293 $forwarder = new \ilContentPagePageCommandForwarder(
300 $pageContent = $forwarder->forward();
301 if (strlen($pageContent) > 0) {
302 $this->tpl->setContent($pageContent);
306 case 'ilinfoscreengui':
307 if (!$this->infoScreenEnabled) {
315 case 'ilcommonactiondispatchergui':
319 case 'ilpermissiongui':
323 $this->tabs->activateTab(self::UI_TAB_ID_PERMISSIONS);
328 case 'illearningprogressgui':
330 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
334 $this->tabs->activateTab(self::UI_TAB_ID_LP);
338 $this->object->getRefId(),
340 $this->request->getQueryParams()[
'user_id']) &&
342 $this->request->getQueryParams()[
'user_id']
344 (
int) $this->request->getQueryParams()[
'user_id'] :
353 $this->tabs->activateTab(self::UI_TAB_ID_EXPORT);
355 $gui = new \ilExportGUI($this);
356 $gui->addFormat(
'xml');
357 $this->ctrl->forwardCommand($gui);
360 case 'ilobjectcustomiconconfigurationgui':
362 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
366 $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
369 require_once
'Services/Object/Icon/classes/class.ilObjectCustomIconConfigurationGUI.php';
370 $gui = new \ilObjectCustomIconConfigurationGUI($this->dic, $this, $this->
object);
371 $this->ctrl->forwardCommand($gui);
374 case 'ilobjectcopygui':
375 $this->tpl->loadStandardTemplate();
377 $gui = new \ilObjectCopyGUI($this);
378 $gui->setType(self::OBJ_TYPE);
380 $this->ctrl->forwardCommand($gui);
385 case in_array(strtolower($cmd), array_map(
'strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE])):
390 if (in_array(strtolower($cmd), array_map(
'strtolower', [
'addToDesk',
'removeFromDesk']))) {
391 $this->ctrl->setCmd($cmd .
'Object');
394 return parent::executeCommand();
406 $this->navHistory->addItem(
407 $this->object->getRefId(),
409 $this->object->getType()
433 if (!$this->infoScreenEnabled) {
438 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
441 $this->tabs->activateTab(self::UI_TAB_ID_INFO);
443 $info = new \ilInfoScreenGUI($this);
444 $info->enableLearningProgress(
true);
445 $info->enablePrivateNotes();
446 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
448 $this->ctrl->forwardCommand($info);
458 $this->tabs->addSubTab(
459 self::UI_TAB_ID_SETTINGS,
460 $this->lng->txt(
'settings'),
461 $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
464 if ($this->
settings->get(
'custom_icons')) {
465 $this->tabs_gui->addSubTab(
466 self::UI_TAB_ID_ICON,
467 $this->lng->txt(
'icon_settings'),
468 $this->ctrl->getLinkTargetByClass(
'ilObjectCustomIconConfigurationGUI')
472 $this->tabs_gui->addSubTab(
473 self::UI_TAB_ID_STYLE,
474 $this->lng->txt(
'cont_style'),
475 $this->ctrl->getLinkTarget($this,
'editStyleProperties')
478 $this->tabs->activateSubTab($activeTab);
487 if ($this->
object instanceof \
ilObject) {
488 $this->locator->addItem(
489 $this->object->getTitle(),
490 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
492 $this->
object->getRefId()
503 $this->ctrl->setCmd(
'showSummary');
504 $this->ctrl->setCmdClass(
'ilinfoscreengui');
521 $this->tabs->activateTab(self::UI_TAB_ID_CONTENT);
522 $this->tabs->activateSubTab(self::UI_TAB_ID_CONTENT);
524 $this->tpl->setPermanentLink($this->object->getType(), $this->
object->getRefId(),
'',
'_top');
535 $this->tabs->addSubTab(
536 self::UI_TAB_ID_CONTENT,
537 $this->lng->txt(
'view'),
538 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
541 if (!$this->
user->isAnonymous()) {
542 $this->lng->loadLanguageModule(
'cntr');
543 $this->tabs->addSubTab(
545 $this->lng->txt(
'cntr_text_media_editor'),
546 $this->ctrl->getLinkTargetByClass(
'ilContentPagePageGUI',
'edit')
560 $this->
object->trackProgress((
int) $this->
user->getId());
564 $forwarder = new \ilContentPagePageCommandForwarder(
573 return $forwarder->forward($ctrlLink);
581 $this->tpl->setVariable(
582 'LOCATION_CONTENT_STYLESHEET',
585 $this->tpl->setCurrentBlock(
'SyntaxStyle');
587 $this->tpl->parseCurrentBlock();
595 \ilUtil::sendSuccess($this->lng->txt(
'object_added'),
true);
596 $this->ctrl->redirect($this,
'edit');
604 parent::setTitleAndDescription();
606 $icon = ilObject::_getIcon($this->object->getId(),
'big', $this->
object->getType());
607 $this->tpl->setTitleIcon($icon, $this->lng->txt(
'obj_' . $this->object->getType()));
616 $sh->setTitle($this->lng->txt(
'obj_features'));
620 $this->object->getId(),
628 $presentationHeader->setTitle($this->lng->txt(
'settings_presentation_header'));
629 $a_form->
addItem($presentationHeader);
630 $this->obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
647 $this->object->getId(),
653 $this->obj_service->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
663 $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
667 $this->tpl->setContent($form->getHTML());
675 $form = new \ilPropertyFormGUI();
677 $fixedStyle = $this->
settings->get(
'fixed_content_style_id');
678 $defaultStyle = $this->
settings->get(
'default_content_style_id');
679 $styleId = $this->
object->getStyleSheetId();
681 if ($fixedStyle > 0) {
691 (
int)
$_GET[
"ref_id"]
694 if ($defaultStyle > 0) {
697 $st_styles[0] = $this->lng->txt(
'default');
703 $st = new \ilNonEditableValueGUI($this->lng->txt(
'cont_current_style'));
707 $form->addCommandButton(
'editStyle', $this->lng->txt(
'cont_edit_style'));
708 $form->addCommandButton(
'deleteStyle', $this->lng->txt(
'cont_delete_style'));
713 $style_sel = new \ilSelectInputGUI($this->lng->txt(
'cont_current_style'),
'style_id');
714 $style_sel->setOptions($st_styles);
715 $style_sel->setValue($styleId);
716 $form->addItem($style_sel);
717 $form->addCommandButton(
'saveStyleSettings', $this->lng->txt(
'save'));
718 $form->addCommandButton(
'createStyle', $this->lng->txt(
'sty_create_ind_style'));
722 $form->setTitle($this->lng->txt(
"cont_style"));
723 $form->setFormAction($this->ctrl->getFormAction($this));
733 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'create');
741 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'edit');
749 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'delete');
761 $this->
settings->get(
'fixed_content_style_id') <= 0 &&
764 $this->object->getStyleSheetId()
766 $this->object->getStyleSheetId() == 0
770 $this->
object->update();
771 ilUtil::sendSuccess($this->lng->txt(
'msg_obj_modified'),
true);
774 $this->ctrl->redirect($this,
'editStyleProperties');
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
afterSave(\ilObject $a_new_object)
getContent(string $ctrlLink='')
setValue($a_value)
Set Value.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
setContentSubTabs()
Sub tab configuration of the content area.
Interface ilContentPageObjectConstants.
initEditCustomForm(\ilPropertyFormGUI $a_form)
setSettingsSubTabs($activeTab)
Sub tab configuration of the settings area.
static _lookupTitle($a_id)
lookup object title
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
Class ilObjContentPageGUI ilObjContentPageGUI: ilRepositoryGUI ilObjContentPageGUI: ilAdministratio...
buildStylePropertiesForm()
static _lookupStandard($a_id)
Lookup standard flag.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
createStyle()
Create Style.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
deleteStyle()
Delete Style.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
getEditFormCustomValues(array &$a_values)
static _lookupObjId($a_id)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getSyntaxStylePath()
get syntax style path
const PRESENTATION_MODE_PRESENTATION
presentation mode for requesting
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
saveStyleSettings()
Save style settings.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
This class represents a non editable value in a property form.
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
view()
Shows the content of the object.
__construct(Container $dic, ilPlugin $plugin)
const LP_CONTEXT_REPOSITORY
updateCustom(\ilPropertyFormGUI $a_form)
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
const INFO_TAB_VISIBILITY
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _goto($target)
Deep link.
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.