73 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
77 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
80 $this->request = $this->dic->http()->request();
81 $this->
settings = $this->dic->settings();
82 $this->access = $this->dic->access();
83 $this->ctrl = $this->dic->ctrl();
84 $this->tabs = $this->dic->tabs();
85 $this->
user = $this->dic->user();
86 $this->navHistory = $this->dic[
'ilNavigationHistory'];
87 $this->error = $this->dic[
'ilErr'];
89 $this->lng->loadLanguageModule(
'copa');
90 $this->lng->loadLanguageModule(
'style');
91 $this->lng->loadLanguageModule(
'content');
95 $this->object->getId(),
107 \ilUtil::sendSuccess($this->lng->txt(
'object_added'),
true);
108 $this->ctrl->redirect($this,
'edit');
116 return self::OBJ_TYPE;
126 self::UI_TAB_ID_CONTENT,
127 $this->lng->txt(
'content'),
128 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
134 self::UI_TAB_ID_INFO,
135 $this->lng->txt(
'info_short'),
136 $this->ctrl->getLinkTargetByClass(
'ilinfoscreengui',
'showSummary')
142 self::UI_TAB_ID_SETTINGS,
143 $this->lng->txt(
'settings'),
144 $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
151 $this->lng->txt(
'learning_progress'),
152 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui')
158 self::UI_TAB_ID_EXPORT,
159 $this->lng->txt(
'export'),
160 $this->ctrl->getLinkTargetByClass(
'ilexportgui')
166 self::UI_TAB_ID_PERMISSIONS,
167 $this->lng->txt(
'perm_settings'),
168 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
'perm')
179 $this->tabs->addSubTab(
180 self::UI_TAB_ID_CONTENT,
181 $this->lng->txt(
'view'),
182 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
185 if (!$this->
user->isAnonymous()) {
186 $this->lng->loadLanguageModule(
'cntr');
187 $this->tabs->addSubTab(
189 $this->lng->txt(
'cntr_text_media_editor'),
190 $this->ctrl->getLinkTargetByClass(
'ilContentPagePageGUI',
'edit')
203 $this->tabs->addSubTab(
204 self::UI_TAB_ID_SETTINGS,
205 $this->lng->txt(
'settings'),
206 $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
209 if ($this->
settings->get(
'custom_icons')) {
210 $this->tabs_gui->addSubTab(
211 self::UI_TAB_ID_ICON,
212 $this->lng->txt(
'icon_settings'),
213 $this->ctrl->getLinkTargetByClass(
'ilObjectCustomIconConfigurationGUI')
217 $this->tabs_gui->addSubTab(
218 self::UI_TAB_ID_STYLE,
219 $this->lng->txt(
'cont_style'),
220 $this->ctrl->getLinkTarget($this,
'editStyleProperties')
223 $this->tabs->setSubTabActive($activeTab);
232 parent::setTitleAndDescription();
234 $icon = ilObject::_getIcon($this->object->getId(),
'big', $this->
object->getType());
235 $this->tpl->setTitleIcon($icon, $this->lng->txt(
'obj_' . $this->object->getType()));
243 $nextClass = $this->ctrl->getNextClass($this);
244 $cmd = $this->ctrl->getCmd(self::UI_CMD_VIEW);
248 if (strtolower($nextClass) !==
'ilobjstylesheetgui') {
252 switch (strtolower($nextClass)) {
253 case 'ilobjstylesheetgui':
258 $this->ctrl->setReturn($this,
'editStyleProperties');
259 $style_gui = new \ilObjStyleSheetGUI(
261 $this->object->getStyleSheetId(),
265 $style_gui->omitLocator();
266 if ($cmd ===
'create' ||
$_GET[
'new_type'] ===
'sty') {
267 $style_gui->setCreationMode(
true);
270 if ($cmd ===
'confirmedDelete') {
271 $this->
object->setStyleSheetId(0);
272 $this->
object->update();
275 $ret = $this->ctrl->forwardCommand($style_gui);
277 if ($cmd ===
'save' || $cmd ===
'copyStyle' || $cmd ===
'importStyle') {
279 $this->
object->setStyleSheetId($styleId);
280 $this->
object->update();
281 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'edit');
285 case 'ilcontentpagepagegui':
286 if (in_array(strtolower($cmd), array_map(
'strtolower', [
287 self::UI_CMD_COPAGE_DOWNLOAD_FILE,
288 self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN,
289 self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH,
293 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
296 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
302 $this->tpl->setCurrentBlock(
'SyntaxStyle');
304 $this->tpl->parseCurrentBlock();
306 $forwarder = new \ilContentPagePageCommandForwarder($this->request, $this->ctrl, $this->tabs, $this->lng, $this->
object);
307 $pageContent = $forwarder->forward();
308 if (strlen($pageContent) > 0) {
309 $this->tpl->setContent($pageContent);
313 case 'ilinfoscreengui':
314 if (!$this->infoScreenEnabled) {
322 case 'ilcommonactiondispatchergui':
326 case 'ilpermissiongui':
330 $this->tabs->activateTab(self::UI_TAB_ID_PERMISSIONS);
335 case 'illearningprogressgui':
337 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
341 $this->tabs->activateTab(self::UI_TAB_ID_LP);
345 $this->object->getRefId(),
346 isset($this->request->getQueryParams()[
'user_id']) && is_numeric($this->request->getQueryParams()[
'user_id']) ?
347 (
int) $this->request->getQueryParams()[
'user_id'] :
356 $this->tabs->activateTab(self::UI_TAB_ID_EXPORT);
358 $gui = new \ilExportGUI($this);
359 $gui->addFormat(
'xml');
360 $this->ctrl->forwardCommand($gui);
363 case 'ilobjectcustomiconconfigurationgui':
365 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
369 $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
372 require_once
'Services/Object/Icon/classes/class.ilObjectCustomIconConfigurationGUI.php';
373 $gui = new \ilObjectCustomIconConfigurationGUI($this->dic, $this, $this->
object);
374 $this->ctrl->forwardCommand($gui);
377 case 'ilobjectcopygui':
378 $this->tpl->getStandardTemplate();
380 $gui = new \ilObjectCopyGUI($this);
381 $gui->setType(self::OBJ_TYPE);
383 $this->ctrl->forwardCommand($gui);
388 case in_array(strtolower($cmd), array_map(
'strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE])):
393 if (in_array(strtolower($cmd), array_map(
'strtolower', [
'addToDesk',
'removeFromDesk']))) {
394 $this->ctrl->setCmd($cmd .
'Object');
397 return parent::executeCommand();
406 if ($this->
object instanceof \
ilObject) {
407 $this->locator->addItem(
408 $this->object->getTitle(),
409 $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
411 $this->
object->getRefId()
423 $this->navHistory->addItem(
424 $this->object->getRefId(),
426 $this->object->getType()
449 $this->ctrl->setCmd(
'showSummary');
450 $this->ctrl->setCmdClass(
'ilinfoscreengui');
460 if (!$this->infoScreenEnabled) {
465 $this->error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
468 $this->tabs->activateTab(self::UI_TAB_ID_INFO);
470 $info = new \ilInfoScreenGUI($this);
471 $info->enableLearningProgress(
true);
472 $info->enablePrivateNotes();
473 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
475 $this->ctrl->forwardCommand(
$info);
484 $sh->setTitle($this->lng->txt(
'obj_features'));
488 $this->object->getId(),
510 $this->object->getId(),
526 $targetAttributes = explode(
'_',
$target);
527 $refId = (int) $targetAttributes[0];
529 if ((
int) $refId <= 0) {
530 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
533 if ($DIC->access()->checkAccess(
'read',
'', $refId)) {
534 $DIC->ctrl()->setTargetScript(
'ilias.php');
535 $DIC->ctrl()->initBaseClass(
'ilRepositoryGUI');
536 $DIC->ctrl()->setParameterByClass(__CLASS__,
'ref_id', $refId);
537 $DIC->ctrl()->redirectByClass(array(
540 ), self::UI_CMD_VIEW);
541 } elseif ($DIC->access()->checkAccess(
'read',
'', ROOT_FOLDER_ID)) {
543 $DIC->language()->txt(
'msg_no_perm_read_item'),
547 $DIC->ctrl()->setTargetScript(
'ilias.php');
548 $DIC->ctrl()->initBaseClass(
'ilRepositoryGUI');
549 $DIC->ctrl()->setParameterByClass(
'ilRepositoryGUI',
'ref_id', ROOT_FOLDER_ID);
550 $DIC->ctrl()->redirectByClass(
'ilRepositoryGUI');
553 $DIC[
'ilErr']->raiseError($DIC->language()->txt(
'msg_no_perm_read'), $DIC[
'ilErr']->FATAL);
561 if ((
int) $this->
settings->get(
'disable_my_offers')) {
562 $this->ctrl->redirect($this, self::UI_CMD_VIEW);
566 \ilUtil::sendSuccess($this->lng->txt(
'added_to_desktop'),
true);
567 $this->ctrl->redirect($this, self::UI_CMD_VIEW);
575 if ((
int) $this->
settings->get(
'disable_my_offers')) {
576 $this->ctrl->redirect($this, self::UI_CMD_VIEW);
580 \ilUtil::sendSuccess($this->lng->txt(
'removed_from_desktop'),
true);
581 $this->ctrl->redirect($this, self::UI_CMD_VIEW);
587 $this->tpl->setCurrentBlock(
'SyntaxStyle');
589 $this->tpl->parseCurrentBlock();
600 $this->
object->trackProgress((
int) $this->
user->getId());
604 $forwarder = new \ilContentPagePageCommandForwarder(
613 return $forwarder->forward($ctrlLink);
628 $this->tabs->activateTab(self::UI_TAB_ID_CONTENT);
629 $this->tabs->activateSubTab(self::UI_TAB_ID_CONTENT);
631 $this->tpl->setPermanentLink($this->object->getType(), $this->
object->getRefId(),
'',
'_top');
643 $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
647 $this->tpl->setContent(
$form->getHTML());
655 $form = new \ilPropertyFormGUI();
657 $fixedStyle = $this->
settings->get(
'fixed_content_style_id');
658 $defaultStyle = $this->
settings->get(
'default_content_style_id');
659 $styleId = $this->
object->getStyleSheetId();
661 if ($fixedStyle > 0) {
671 (
int)
$_GET[
"ref_id"]
674 if ($defaultStyle > 0) {
677 $st_styles[0] = $this->lng->txt(
'default');
683 $st = new \ilNonEditableValueGUI($this->lng->txt(
'cont_current_style'));
687 $form->addCommandButton(
'editStyle', $this->lng->txt(
'cont_edit_style'));
688 $form->addCommandButton(
'deleteStyle', $this->lng->txt(
'cont_delete_style'));
693 $style_sel = new \ilSelectInputGUI($this->lng->txt(
'cont_current_style'),
'style_id');
694 $style_sel->setOptions($st_styles);
695 $style_sel->setValue($styleId);
696 $form->addItem($style_sel);
697 $form->addCommandButton(
'saveStyleSettings', $this->lng->txt(
'save'));
698 $form->addCommandButton(
'createStyle', $this->lng->txt(
'sty_create_ind_style'));
702 $form->setTitle($this->lng->txt(
"cont_style"));
703 $form->setFormAction($this->ctrl->getFormAction($this));
713 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'create');
721 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'edit');
729 $this->ctrl->redirectByClass(
'ilobjstylesheetgui',
'delete');
740 $this->
settings->get(
'fixed_content_style_id') <= 0 &&
743 $this->
object->update();
744 ilUtil::sendSuccess($this->lng->txt(
'msg_obj_modified'),
true);
747 $this->ctrl->redirect($this,
'editStyleProperties');
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.
removeFromDeskObject()
Remove from desktop public.
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...
addToDeskObject()
Add desktop item public.
static addToDesktop()
Add desktop item public.
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.
if(isset($_POST['submit'])) $form
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 getContentStylePath($a_style_id, $add_random=true)
get content style path
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
saveStyleSettings()
Save style settings.
static removeFromDesktop()
Remove item from personal desktop public.
__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.
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.