3 declare(strict_types=1);
45 ?
int $current_style_id,
50 $this->main_tpl = $DIC->ui()->mainTemplate();
51 $this->domain = $domain_service;
52 $this->gui = $gui_service;
54 $this->obj_id = ($obj_id > 0)
58 $this->object_manager = $domain_service->
object($ref_id, $this->obj_id);
59 $this->current_style_id = $current_style_id ?? $this->object_manager->getStyleId();
64 $ctrl = $this->gui->ctrl();
66 $next_class = $ctrl->getNextClass($this);
67 $cmd = $ctrl->getCmd(
"settings");
69 switch ($next_class) {
70 case "ilobjstylesheetgui":
71 $this->gui->tabs()->clearTargets();
72 $ctrl->setReturn($this,
"settings");
84 "saveIndividualStyleSettings" 93 $mt = $this->gui->mainTemplate();
105 $ilCtrl = $this->gui->ctrl();
106 $lng = $this->domain->lng();
107 $tabs = $this->gui->tabs();
109 $mt = $this->gui->mainTemplate();
123 $lng->loadLanguageModule(
"style");
126 if ($this->object_manager->globalFixed()) {
128 $st->setValue($this->object_manager->getGlobalFixedTitle() .
" (" .
129 $lng->txt(
"global_fixed") .
")");
132 $st_styles = $this->object_manager->getSelectableStyles();
134 $st_styles[0] =
$lng->txt(
"default");
138 if ($this->object_manager->hasEffectiveIndividualStyle($style_id)) {
145 $cb->setInfo(
$lng->txt(
"style_support_reuse_info"));
146 $cb->setChecked($this->container_manager->getReuse());
148 $form->addCommandButton(
149 "saveIndividualStyleSettings",
154 $form->addCommandButton(
156 $lng->txt(
"style_edit_style")
158 $form->addCommandButton(
160 $lng->txt(
"style_delete_style")
164 if ($this->object_manager->canSelectStyle($style_id)) {
166 $lng->txt(
"style_current_style"),
170 $style_sel->setValue($style_id);
171 $form->addItem($style_sel);
172 $form->addCommandButton(
176 $form->addCommandButton(
178 $lng->txt(
"sty_create_ind_style")
182 $form->setTitle(
$lng->txt(
"obj_sty"));
183 $form->setFormAction($ilCtrl->getFormAction($this));
190 if ($this->ref_id > 0) {
192 if ($this->domain->objectDefinition()->isContainer($type)) {
201 $ctrl = $this->gui->ctrl();
202 $cmd = $ctrl->getCmd();
206 $this->current_style_id,
209 $style_id = $ctrl->forwardCommand($style_gui);
210 if (in_array($cmd, [
"save",
"copyStyle",
"importStyle",
"confirmedDelete"])) {
211 $style_id = $style_gui->getObject()->getId();
212 if ($cmd ==
"confirmedDelete") {
218 if (in_array($cmd, [
"save",
"copyStyle",
"importStyle"])) {
219 $ctrl->redirect($this,
"editStyle");
221 $ctrl->redirect($this,
"settings");
227 $this->object_manager->updateStyleId($style_id);
232 $this->object_manager->setOwnerOfStyle($style_id);
237 $ctrl = $this->gui->ctrl();
238 $ctrl->redirectByClass(
"ilobjstylesheetgui",
"create");
243 $ctrl = $this->gui->ctrl();
244 $ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
249 $ctrl = $this->gui->ctrl();
250 $ctrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
259 $lng = $this->domain->lng();
260 $ctrl = $this->gui->ctrl();
264 if ($this->object_manager->canSelectStyle($this->current_style_id)) {
265 $style_id = (
int) $form->getInput(
"style_id");
267 $this->main_tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
269 $ctrl->redirect($this,
"settings");
274 $lng = $this->domain->lng();
275 $ctrl = $this->gui->ctrl();
280 $this->container_manager->saveReuse((
bool) $form->getInput(
"support_reuse"));
281 $this->main_tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
283 $ctrl->redirect($this,
"settings");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
repositoryContainer(int $ref_id)
Content style internal ui factory.
updateStyleId(int $style_id)
saveStyleSettings()
Save style settings.
__construct(InternalDomainService $domain_service, InternalGUIService $gui_service, ?int $current_style_id, int $ref_id, int $obj_id)
saveIndividualStyleSettings()
Manages repository object related content style behaviour.
ilGlobalTemplateInterface $main_tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
object(int $ref_id, int $obj_id=0)
Objects without ref id (e.g.
ContainerManager $container_manager
InternalDomainService $domain
static _lookupTitle(int $obj_id)
setOwnerId(int $style_id)
initStylePropertiesForm()
Init style properties form.
static _lookupType(int $id, bool $reference=false)
ObjectManager $object_manager
Manages container related content style behaviour.