ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilContainerPageGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
31{
34 protected int $requested_ref_id = 0;
35
36 public function __construct(
37 int $a_id = 0,
38 int $a_old_nr = 0,
39 string $a_lang = ""
40 ) {
42 global $DIC;
43
44 $this->tpl = $DIC["tpl"];
45 $this->obj_definition = $DIC["objDefinition"];
46 $request = $DIC->container()->internal()->gui()->standardRequest();
47 $this->requested_ref_id = $request->getRefId();
48
49 parent::__construct("cont", $a_id, $a_old_nr, false, $a_lang);
50 }
51
52 public function getProfileBackUrl(): string
53 {
54 $link = ilLink::_getLink($this->requested_ref_id);
55 // make it relative, since profile only accepts relative links as back links
56 $link = substr($link, strpos($link, "//") + 2);
57 $link = substr($link, strpos($link, "/"));
58 return $link;
59 }
60
61 public function finishEditing(): void
62 {
63 $this->ctrl->returnToParent($this);
64 }
65
66 public function getAdditionalPageActions(): array
67 {
69 $ui = $this->ui;
71
73 ilObject::_lookupObjectId($this->requested_ref_id)
74 );
75
76 $class = $this->obj_definition->getClassName($type);
77
78 $items = [];
79 if ($class !== "") {
80 $items[] = $ui->factory()->link()->standard(
81 $lng->txt("obj_sty"),
83 ilRepositoryGUI::class,
84 "ilObj" . $class . "GUI",
85 ilObjectContentStyleSettingsGUI::class
86 ], "")
87 );
88 }
89 return $items;
90 }
91
93 \ILIAS\Container\Content\ItemPresentationManager $manager
94 ): void {
95 $this->item_presentation_mnager = $manager;
96 }
97
98 public function getItemPresentationManager(): ?\ILIAS\Container\Content\ItemPresentationManager
99 {
100 return $this->item_presentation_mnager;
101 }
102
103 public function edit(): string
104 {
105 $this->getPageObject()->addMissingContainerBlocks($this->item_presentation_mnager);
106 return parent::edit();
107 }
108
109 public function afterDeleteContents(): void
110 {
111 $this->getPageObject()->addMissingContainerBlocks($this->item_presentation_mnager);
112 }
113}
Container page GUI class.
setItemPresentationManager(\ILIAS\Container\Content\ItemPresentationManager $manager)
getAdditionalPageActions()
Get additional page actions.
ILIAS Container Content ItemPresentationManager $item_presentation_mnager
ilObjectDefinition $obj_definition
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
parses the objects.xml it handles the xml-description of all ilias objects
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
Class ilPageObjectGUI.
ILIAS COPage Link LinkManager $link
ILIAS DI UIServices $ui
EditGUIRequest $request
__construct(string $a_parent_type, int $a_id, int $a_old_nr=0, bool $a_prevent_get_id=false, string $a_lang="", string $concrete_lang="")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:26