62    public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
   69        $this->request = $this->dic->http()->request();
 
   70        $this->
settings = $this->dic->settings();
 
   71        $this->access = $this->dic->access();
 
   72        $this->ctrl = $this->dic->ctrl();
 
   73        $this->tabs = $this->dic->tabs();
 
   74        $this->
user = $this->dic->user();
 
   75        $this->obj_service = $this->dic->object();
 
   76        $this->navHistory = $this->dic[
'ilNavigationHistory'];
 
   77        $this->
error = $this->dic[
'ilErr'];
 
   78        $this->
help = $DIC[
'ilHelp'];
 
   79        $this->uiServices = 
$DIC->ui();
 
   81        $this->lng->loadLanguageModule(
'copa');
 
   82        $this->lng->loadLanguageModule(
'style');
 
   83        $this->lng->loadLanguageModule(
'content');
 
   87                $this->object->getId(),
 
   93        $this->in_page_editor_style_context = (
 
  102        $this->ctrl->saveParameter($this, self::HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT);
 
  108    public static function _goto(
string $target) : void
 
  112        $targetAttributes = explode(
'_', $target);
 
  113        $refId = (int) $targetAttributes[0];
 
  116            $DIC[
'ilErr']->raiseError(
$DIC->language()->txt(
'msg_no_perm_read'), 
$DIC[
'ilErr']->FATAL);
 
  119        if (
$DIC->access()->checkAccess(
'read', 
'', 
$refId)) {
 
  120            $DIC->ctrl()->setTargetScript(
'ilias.php');
 
  121            $DIC->ctrl()->initBaseClass(
'ilRepositoryGUI');
 
  122            if (isset(
$DIC->http()->request()->getQueryParams()[
'gotolp'])) {
 
  123                $DIC->ctrl()->setParameterByClass(__CLASS__, 
'gotolp', 1);
 
  125            $DIC->ctrl()->setParameterByClass(__CLASS__, 
'ref_id', 
$refId);
 
  126            $DIC->ctrl()->redirectByClass([
 
  129            ], self::UI_CMD_VIEW);
 
  130        } elseif (
$DIC->access()->checkAccess(
"visible", 
"", $target)) {
 
  134                $DIC->language()->txt(
'msg_no_perm_read_item'),
 
  138            $DIC->ctrl()->setTargetScript(
'ilias.php');
 
  139            $DIC->ctrl()->initBaseClass(
'ilRepositoryGUI');
 
  141            $DIC->ctrl()->redirectByClass(
'ilRepositoryGUI');
 
  144        $DIC[
'ilErr']->raiseError(
$DIC->language()->txt(
'msg_no_perm_read'), 
$DIC[
'ilErr']->FATAL);
 
  160        $this->
help->setScreenIdComponent($this->object->getType());
 
  162        if ($this->in_page_editor_style_context) {
 
  168                self::UI_TAB_ID_CONTENT,
 
  169                $this->lng->txt(
'content'),
 
  170                $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW)
 
  176                self::UI_TAB_ID_INFO,
 
  177                $this->lng->txt(
'info_short'),
 
  178                $this->ctrl->getLinkTargetByClass(
'ilinfoscreengui', 
'showSummary')
 
  184                self::UI_TAB_ID_SETTINGS,
 
  185                $this->lng->txt(
'settings'),
 
  186                $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
 
  193                $this->lng->txt(
'learning_progress'),
 
  194                $this->ctrl->getLinkTargetByClass(
'illearningprogressgui')
 
  200                self::UI_TAB_ID_EXPORT,
 
  201                $this->lng->txt(
'export'),
 
  202                $this->ctrl->getLinkTargetByClass(
'ilexportgui')
 
  208                self::UI_TAB_ID_PERMISSIONS,
 
  209                $this->lng->txt(
'perm_settings'),
 
  210                $this->ctrl->getLinkTargetByClass(
'ilpermissiongui', 
'perm')
 
  223        $nextClass = $this->ctrl->getNextClass($this);
 
  224        $cmd = $this->ctrl->getCmd(self::UI_CMD_VIEW);
 
  229            !$this->in_page_editor_style_context &&
 
  230            strtolower($nextClass) !== strtolower(ilObjStyleSheetGUI::class) &&
 
  232                strtolower($cmd) !== strtolower(self::UI_CMD_EDIT) ||
 
  233                strtolower($nextClass) !== strtolower(ilContentPagePageGUI::class)
 
  239        switch (strtolower($nextClass)) {
 
  240            case 'ilobjecttranslationgui':
 
  244                $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
 
  248                $this->ctrl->forwardCommand($transgui);
 
  251            case 'ilobjstylesheetgui':
 
  256                $this->ctrl->setReturn($this, 
'editStyleProperties');
 
  259                    $this->object->getStyleSheetId(),
 
  263                $style_gui->omitLocator();
 
  264                if ($cmd === 
'create' || 
$_GET[
'new_type'] === 
'sty') {
 
  265                    $style_gui->setCreationMode(
true);
 
  268                if ($cmd === 
'confirmedDelete') {
 
  269                    $this->
object->setStyleSheetId(0);
 
  270                    $this->
object->update();
 
  273                $ret = $this->ctrl->forwardCommand($style_gui);
 
  275                if ($cmd === 
'save' || $cmd === 
'copyStyle' || $cmd === 
'importStyle') {
 
  277                    $this->
object->setStyleSheetId($styleId);
 
  278                    $this->
object->update();
 
  279                    $this->ctrl->redirectByClass(
'ilobjstylesheetgui', 
'edit');
 
  283            case 'ilcontentpagepagegui':
 
  284                $isMediaRequest = in_array(strtolower($cmd), array_map(
'strtolower', [
 
  285                    self::UI_CMD_COPAGE_DOWNLOAD_FILE,
 
  286                    self::UI_CMD_COPAGE_DISPLAY_FULLSCREEN,
 
  287                    self::UI_CMD_COPAGE_DISPLAY_MEDIA,
 
  288                    self::UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH,
 
  290                if ($isMediaRequest) {
 
  292                        $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  295                    $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  300                $this->tpl->setVariable(
 
  301                    'LOCATION_CONTENT_STYLESHEET',
 
  304                $this->tpl->setCurrentBlock(
'SyntaxStyle');
 
  306                $this->tpl->parseCurrentBlock();
 
  316                $forwarder->setIsMediaRequest($isMediaRequest);
 
  319                    $this->pageMetricsService->store(
 
  321                            (
int) $this->object->getId(),
 
  322                            $event->
page()->getLanguage()
 
  327                $pageContent = $forwarder->forward();
 
  328                if (strlen($pageContent) > 0) {
 
  329                    $this->tpl->setContent($pageContent);
 
  333            case 'ilinfoscreengui':
 
  334                if (!$this->infoScreenEnabled) {
 
  342            case 'ilcommonactiondispatchergui':
 
  347            case 'ilpermissiongui':
 
  351                $this->tabs->activateTab(self::UI_TAB_ID_PERMISSIONS);
 
  356            case 'illearningprogressgui':
 
  358                    $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  362                $this->tabs->activateTab(self::UI_TAB_ID_LP);
 
  366                    $this->object->getRefId(),
 
  368                        $this->request->getQueryParams()[
'user_id']) &&
 
  370                            $this->request->getQueryParams()[
'user_id']
 
  372                        (
int) $this->request->getQueryParams()[
'user_id'] :
 
  381                $this->tabs->activateTab(self::UI_TAB_ID_EXPORT);
 
  384                $gui->addFormat(
'xml');
 
  385                $this->ctrl->forwardCommand($gui);
 
  388            case 'ilobjectcustomiconconfigurationgui':
 
  390                    $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  394                $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
 
  397                require_once 
'Services/Object/Icon/classes/class.ilObjectCustomIconConfigurationGUI.php';
 
  399                $this->ctrl->forwardCommand($gui);
 
  402            case 'ilobjectcopygui':
 
  403                $this->tpl->loadStandardTemplate();
 
  406                $gui->setType(self::OBJ_TYPE);
 
  408                $this->ctrl->forwardCommand($gui);
 
  413                    case in_array(strtolower($cmd), array_map(
'strtolower', [self::UI_CMD_EDIT, self::UI_CMD_UPDATE])):
 
  418                if (in_array(strtolower($cmd), array_map(
'strtolower', [
'addToDesk', 
'removeFromDesk']))) {
 
  419                    $this->ctrl->setCmd($cmd . 
'Object');
 
  422                return parent::executeCommand();
 
  431                $this->navHistory->addItem(
 
  432                    $this->object->getRefId(),
 
  434                    $this->object->getType()
 
  454        if (!$this->infoScreenEnabled) {
 
  459            $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  462        $this->tabs->activateTab(self::UI_TAB_ID_INFO);
 
  465        $info->enableLearningProgress(
true);
 
  466        $info->enablePrivateNotes();
 
  467        $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
 
  469        $this->ctrl->forwardCommand($info);
 
  479            $this->tabs->addSubTab(
 
  480                self::UI_TAB_ID_SETTINGS,
 
  481                $this->lng->txt(
'settings'),
 
  482                $this->ctrl->getLinkTarget($this, self::UI_CMD_EDIT)
 
  485            if ($this->
settings->get(
'custom_icons')) {
 
  486                $this->tabs_gui->addSubTab(
 
  487                    self::UI_TAB_ID_ICON,
 
  488                    $this->lng->txt(
'icon_settings'),
 
  489                    $this->ctrl->getLinkTargetByClass(
'ilObjectCustomIconConfigurationGUI')
 
  493            $this->tabs_gui->addSubTab(
 
  494                self::UI_TAB_ID_STYLE,
 
  495                $this->lng->txt(
'cont_style'),
 
  496                $this->ctrl->getLinkTarget($this, 
'editStyleProperties')
 
  499            $this->tabs_gui->addSubTab(
 
  500                self::UI_TAB_ID_I18N,
 
  501                $this->lng->txt(
'obj_multilinguality'),
 
  502                $this->ctrl->getLinkTargetByClass(ilObjectTranslationGUI::class)
 
  505            $this->tabs->activateSubTab($activeTab);
 
  514        if ($this->
object instanceof 
ilObject) {
 
  515            $this->locator->addItem(
 
  516                $this->object->getTitle(),
 
  517                $this->ctrl->getLinkTarget($this, self::UI_CMD_VIEW),
 
  519                $this->object->getRefId()
 
  530        $this->ctrl->setCmd(
'showSummary');
 
  531        $this->ctrl->setCmdClass(
'ilinfoscreengui');
 
  548        $this->tabs->activateTab(self::UI_TAB_ID_CONTENT);
 
  550        $this->tpl->setPermanentLink($this->object->getType(), $this->object->getRefId(), 
'', 
'_top');
 
  557        if (!$this->
user->isAnonymous() && $this->checkPermissionBool(
'write')) {
 
  558            $this->lng->loadLanguageModule(
'cntr');
 
  559            $this->toolbar->addComponent(
 
  560                $this->uiServices->factory()->button()->primary(
 
  561                    $this->lng->txt(
'cntr_text_media_editor'),
 
  562                    $this->ctrl->getLinkTargetByClass(ilContentPagePageGUI::class, 
'edit')
 
  576            $this->
object->trackProgress((
int) $this->
user->getId());
 
  590            return $forwarder->forward($ctrlLink);
 
  598        $this->tpl->setVariable(
 
  599            'LOCATION_CONTENT_STYLESHEET',
 
  602        $this->tpl->setCurrentBlock(
'SyntaxStyle');
 
  604        $this->tpl->parseCurrentBlock();
 
  612        $a_new_object->getObjectTranslation()->addLanguage(
 
  613            $this->lng->getDefaultLanguage(),
 
  619        $a_new_object->getObjectTranslation()->save();
 
  621        ilUtil::sendSuccess($this->lng->txt(
'object_added'), 
true);
 
  622        $this->ctrl->redirect($this, 
'edit');
 
  630        parent::setTitleAndDescription();
 
  633        $this->tpl->setTitleIcon($icon, $this->lng->txt(
'obj_' . $this->object->getType()));
 
  642        $sh->setTitle($this->lng->txt(
'obj_features'));
 
  646            $this->object->getId(),
 
  654        $presentationHeader->setTitle($this->lng->txt(
'settings_presentation_header'));
 
  655        $a_form->
addItem($presentationHeader);
 
  656        $this->obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
 
  658        if ($this->
getCreationMode() !== 
true && count($this->object->getObjectTranslation()->getLanguages()) > 1) {
 
  665                            $this->lng->txt(
'language'),
 
  666                            $languages[$this->object->getObjectTranslation()->getDefaultLanguage()]
 
  680        if (count($this->object->getObjectTranslation()->getLanguages()) > 1) {
 
  681            $a_values[
'title'] = $this->
object->getObjectTranslation()->getDefaultTitle();
 
  682            $a_values[
'desc'] = $this->
object->getObjectTranslation()->getDefaultDescription();
 
  692            $this->object->getId(),
 
  698        $this->obj_service->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
 
  708        if (!$this->in_page_editor_style_context) {
 
  709            $this->tabs->activateTab(self::UI_TAB_ID_SETTINGS);
 
  715        if ($this->in_page_editor_style_context) {
 
  716            $this->tabs->setBackTarget(
 
  717                $this->lng->txt(
'back'),
 
  718                $this->ctrl->getLinkTargetByClass(ilContentPagePageGUI::class, 
'edit')
 
  730            $forwarder->forward(
'');
 
  731            $this->tabs->setTabActive(
'obj_sty');
 
  733        $this->tpl->setContent($form->getHTML());
 
  743        $fixedStyle = $this->
settings->get(
'fixed_content_style_id');
 
  744        $defaultStyle = $this->
settings->get(
'default_content_style_id');
 
  745        $styleId = $this->
object->getStyleSheetId();
 
  747        if ($fixedStyle > 0) {
 
  757                (
int) 
$_GET[
"ref_id"]
 
  760            if ($defaultStyle > 0) {
 
  763                $st_styles[0] = $this->lng->txt(
'default');
 
  773                    $form->addCommandButton(
'editStyle', $this->lng->txt(
'cont_edit_style'));
 
  774                    $form->addCommandButton(
'deleteStyle', $this->lng->txt(
'cont_delete_style'));
 
  779                $style_sel = 
new ilSelectInputGUI($this->lng->txt(
'cont_current_style'), 
'style_id');
 
  780                $style_sel->setOptions($st_styles);
 
  781                $style_sel->setValue($styleId);
 
  782                $form->addItem($style_sel);
 
  783                $form->addCommandButton(
'saveStyleSettings', $this->lng->txt(
'save'));
 
  784                $form->addCommandButton(
'createStyle', $this->lng->txt(
'sty_create_ind_style'));
 
  788        $form->setTitle($this->lng->txt(
"cont_style"));
 
  789        $form->setFormAction($this->ctrl->getFormAction($this));
 
  796        $this->ctrl->redirectByClass(
'ilobjstylesheetgui', 
'create');
 
  801        $this->ctrl->redirectByClass(
'ilobjstylesheetgui', 
'edit');
 
  806        $this->ctrl->redirectByClass(
'ilobjstylesheetgui', 
'delete');
 
  817            $this->
settings->get(
'fixed_content_style_id') <= 0 &&
 
  820                    $this->object->getStyleSheetId()
 
  822                $this->object->getStyleSheetId() == 0
 
  826            $this->
object->update();
 
  827            ilUtil::sendSuccess($this->lng->txt(
'msg_obj_modified'), 
true);
 
  830        $this->ctrl->redirect($this, self::UI_CMD_STYLES_EDIT);
 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
Class ilContentPagePageCommandForwarder.
const PRESENTATION_MODE_PREVIEW
const PRESENTATION_MODE_PRESENTATION
presentation mode for requesting
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
This class represents a non editable value in a property form.
Class ilObjContentPageGUI @ilCtrl_isCalledBy ilObjContentPageGUI: ilRepositoryGUI @ilCtrl_isCalledBy ...
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
static _goto(string $target)
addLocatorItems()
Functions to be overwritten.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
setSettingsSubTabs(string $activeTab)
Sub tab configuration of the settings area.
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
setTitleAndDescription()
called by prepare output
getType()
Functions that must be overwritten.
buildStylePropertiesForm()
setTabs()
create tabs (repository/workspace switch)this had to be moved here because of the context-specific pe...
view()
Shows the content of the object.
executeCommand()
execute command
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
getContent(string $ctrlLink='')
$in_page_editor_style_context
Class ilObjStyleSheetGUI.
static _lookupStandard($a_id)
Lookup standard flag.
static getSyntaxStylePath()
get syntax style path
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
New implementation of ilObjectGUI.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
GUI class for the workflow of copying objects.
Class ilObjectCustomIconConfigurationGUI.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
addHeaderAction()
Add header action menu.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
const INFO_TAB_VISIBILITY
GUI class for object translation handling.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
getDescription()
get object description
getTitle()
get object title @access public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Interface ilContentPageObjectConstants.
const HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc