ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilContentStyleSettingsGUI Class Reference

Settings UI class for system styles. More...

+ Collaboration diagram for ilContentStyleSettingsGUI:

Public Member Functions

 __construct (ilObjStyleSettingsGUI $a_parent_gui)
 
 executeCommand ()
 
 checkPermission (string $a_perm, bool $a_throw_exc=true)
 Check permission. More...
 
 createStyle ()
 
 edit ()
 List styles. More...
 
 import ()
 
 moveLMStyles ()
 move learning modules from one style to another More...
 
 moveIndividualStyles ()
 move all learning modules with individual styles to new style More...
 
 confirmDeleteIndividualStyles ()
 
 deleteStyle ()
 display deletion confirmation screen More...
 
 confirmedDelete ()
 delete selected style objects More...
 
 toggleGlobalDefault ()
 Toggle global default style. More...
 
 toggleGlobalFixed ()
 Toggle global fixed style. More...
 
 saveActiveStyles ()
 
 showActions (bool $with_subobjects=false)
 show possible action (form buttons) More...
 
 cancelDelete ()
 
 setScope ()
 
 saveScope ()
 

Protected Member Functions

 getImportForm ()
 

Protected Attributes

InternalGUIService $gui
 
ilContentStyleSettings $cs_settings
 
ilObjStyleSettingsGUI $parent_gui
 
int $obj_id
 
StandardGUIRequest $request
 
ilSetting $settings
 
ilTree $tree
 
ilCtrl $ctrl
 
ilRbacSystem $rbacsystem
 
ilToolbarGUI $toolbar
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ILIAS DI Container $DIC
 
int $ref_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilContentStyleSettingsGUI::__construct ( ilObjStyleSettingsGUI  $a_parent_gui)

Definition at line 48 of file class.ilContentStyleSettingsGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\toolbar().

49  {
50  global $DIC;
51 
52  $this->tree = $DIC->repositoryTree();
53  $this->settings = $DIC->settings();
54 
55  $this->parent_gui = $a_parent_gui;
56  $this->ctrl = $DIC->ctrl();
57  $this->rbacsystem = $DIC->rbac()->system();
58  $this->toolbar = $DIC->toolbar();
59  $this->lng = $DIC->language();
60  $this->tpl = $DIC->ui()->mainTemplate();
61  $this->request = $DIC->contentStyle()
62  ->internal()
63  ->gui()
64  ->standardRequest();
65 
66  $this->ref_id = $this->request->getRefId();
67  $this->obj_id = $this->request->getObjId(); // note that reference ID is the id of the style settings node and object ID may be a style sheet object ID
68 
69  $this->cs_settings = new ilContentStyleSettings();
70  $this->gui = $DIC->contentStyle()->internal()->gui();
71  }
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelDelete()

ilContentStyleSettingsGUI::cancelDelete ( )

Definition at line 455 of file class.ilContentStyleSettingsGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

455  : void
456  {
457  $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_cancel"), true);
458  $this->ctrl->redirect($this, "edit");
459  }
+ Here is the call graph for this function:

◆ checkPermission()

ilContentStyleSettingsGUI::checkPermission ( string  $a_perm,
bool  $a_throw_exc = true 
)

Check permission.

Exceptions
ilObjectException

Definition at line 120 of file class.ilContentStyleSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by confirmDeleteIndividualStyles(), confirmedDelete(), deleteStyle(), edit(), moveIndividualStyles(), moveLMStyles(), saveScope(), setScope(), toggleGlobalDefault(), and toggleGlobalFixed().

120  : bool
121  {
122  if (!$this->rbacsystem->checkAccess($a_perm, $this->ref_id)) {
123  if ($a_throw_exc) {
124  throw new ilObjectException($this->lng->txt("permission_denied"));
125  }
126  return false;
127  }
128  return true;
129  }
Base exception class for object service.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteIndividualStyles()

ilContentStyleSettingsGUI::confirmDeleteIndividualStyles ( )

Definition at line 288 of file class.ilContentStyleSettingsGUI.php.

References ilObject\_lookupTitle(), checkPermission(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by moveLMStyles().

288  : void
289  {
290  $this->checkPermission("sty_write_content");
291 
292  $this->ctrl->setParameter($this, "to_style", $this->request->getToStyleId());
293 
294  $cgui = new ilConfirmationGUI();
295  $cgui->setFormAction($this->ctrl->getFormAction($this));
296  $cgui->setHeaderText($this->lng->txt("sty_confirm_del_ind_styles") . ": " .
297  sprintf(
298  $this->lng->txt("sty_confirm_del_ind_styles_desc"),
299  ilObject::_lookupTitle($this->request->getToStyleId())
300  ));
301  $cgui->setCancel($this->lng->txt("cancel"), "edit");
302  $cgui->setConfirm($this->lng->txt("ok"), "moveIndividualStyles");
303  $this->tpl->setContent($cgui->getHTML());
304  }
static _lookupTitle(int $obj_id)
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmedDelete()

ilContentStyleSettingsGUI::confirmedDelete ( )

delete selected style objects

Definition at line 338 of file class.ilContentStyleSettingsGUI.php.

References $id, checkPermission(), ILIAS\Repository\ctrl(), and ilObjectFactory\getInstanceByObjId().

338  : void
339  {
340  $this->checkPermission("sty_write_content");
341 
342  $ids = $this->request->getIds();
343  foreach ($ids as $id) {
344  $set = new ilContentStyleSettings();
345  $set->removeStyle($id);
346  $set->update();
347 
348  $style_obj = ilObjectFactory::getInstanceByObjId($id);
349  $style_obj->delete();
350  }
351 
352  $this->ctrl->redirect($this, "edit");
353  }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ createStyle()

ilContentStyleSettingsGUI::createStyle ( )

Definition at line 131 of file class.ilContentStyleSettingsGUI.php.

References $ctrl, and ilCtrl\redirectByClass().

131  : void
132  {
133  $ilCtrl = $this->ctrl;
134 
135  // $ilCtrl->setParameterByClass("ilobjstylesheetgui", "new_type", "sty");
136  $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
137  }
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ deleteStyle()

ilContentStyleSettingsGUI::deleteStyle ( )

display deletion confirmation screen

Definition at line 309 of file class.ilContentStyleSettingsGUI.php.

References $id, ilObject\_lookupTitle(), checkPermission(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

309  : void
310  {
311  $this->checkPermission("sty_write_content");
312 
313  $ids = $this->request->getIds();
314  if (count($ids) == 0) {
315  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
316  $this->ctrl->redirect($this, "edit");
317  }
318 
319  // display confirmation message
320  $cgui = new ilConfirmationGUI();
321  $cgui->setFormAction($this->ctrl->getFormAction($this));
322  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
323  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
324  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
325 
326  foreach ($ids as $id) {
327  $caption = ilObject::_lookupTitle($id);
328 
329  $cgui->addItem("id[]", (string) $id, $caption);
330  }
331 
332  $this->tpl->setContent($cgui->getHTML());
333  }
static _lookupTitle(int $obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ edit()

ilContentStyleSettingsGUI::edit ( )

List styles.

Definition at line 142 of file class.ilContentStyleSettingsGUI.php.

References $data, ilObjContentObject\_getNrLMsIndividualStyles(), ilObjContentObject\_getNrLMsNoStyle(), ilObjContentObject\_getNrOfAssignedLMs(), ilObjStyleSheet\_lookupActive(), checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilSelectInputGUI\setOptions(), and ILIAS\Repository\toolbar().

142  : void
143  {
144  $this->checkPermission("visible,read");
145 
146  // @todo: check these, they are checked later, but never (ILIAS 6) set
147  $fixed_style = 0;
148  $default_style = 0;
149 
150  // this may not be cool, if styles are organised as (independent) Service
151  $from_styles = $to_styles = $data = array();
152  $styles = $this->cs_settings->getStyles();
153  foreach ($styles as $style) {
154  $style["active"] = ilObjStyleSheet::_lookupActive((int) $style["id"]);
155  $style["lm_nr"] = ilObjContentObject::_getNrOfAssignedLMs((int) $style["id"]);
156  $data[$style["title"] . ":" . $style["id"]]
157  = $style;
158  if ($style["lm_nr"] > 0) {
159  $from_styles[$style["id"]] = $style["title"];
160  }
161  if ($style["active"] > 0) {
162  $to_styles[$style["id"]] = $style["title"];
163  }
164  }
165 
166  // number of individual styles
167  if ($fixed_style <= 0) {
168  $data[-1] =
169  array("title" => $this->lng->txt("sty_individual_styles"),
170  "id" => 0,
172  );
173  $from_styles[-1] = $this->lng->txt("sty_individual_styles");
174  }
175 
176  // number of default style (fallback default style)
177  if ($default_style <= 0 && $fixed_style <= 0) {
178  $data[0] =
179  array("title" => $this->lng->txt("sty_default_style"),
180  "id" => 0,
182  );
183  $from_styles[0] = $this->lng->txt("sty_default_style");
184  $to_styles[0] = $this->lng->txt("sty_default_style");
185  }
186 
187  $rendered_modal = "";
188  if ($this->checkPermission("sty_write_content", false)) {
189  $this->toolbar->addButton(
190  $this->lng->txt("sty_add_content_style"),
191  $this->ctrl->getLinkTarget($this, "createStyle")
192  );
193 
194  /*
195  $modal = $this->gui->modal($this->lng->txt("import"))
196  ->form($this->getImportForm());
197  $modal_c = $modal->getTriggerButtonComponents($this->lng->txt("import"), false);
198  $this->toolbar->addComponent($modal_c["button"]);
199  $rendered_modal = $this->gui->ui()->renderer()->render($modal_c["modal"]);*/
200 
201  $this->toolbar->addSeparator();
202 
203  // from styles selector
204  $si = new ilSelectInputGUI(
205  $this->lng->txt("sty_move_lm_styles") . ": " . $this->lng->txt("sty_from"),
206  "from_style"
207  );
208  $si->setOptions($from_styles);
209  $this->toolbar->addInputItem($si, true);
210 
211  // from styles selector
212  $si = new ilSelectInputGUI($this->lng->txt("sty_to"), "to_style");
213  $si->setOptions($to_styles);
214  $this->toolbar->addInputItem($si, true);
215  $this->toolbar->addFormButton($this->lng->txt("sty_move_style"), "moveLMStyles");
216 
217  $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
218  }
219 
220  $table = new ilContentStylesTableGUI($this, "edit", $data);
221  $this->tpl->setContent($table->getHTML() . $rendered_modal);
222  }
static _getNrOfAssignedLMs(int $a_style_id)
gets the number of learning modules assigned to a content style
static _getNrLMsNoStyle()
get number of learning modules assigned no style
This class represents a selection list property in a property form.
setOptions(array $a_options)
static _lookupActive(int $a_id)
Lookup active flag.
static _getNrLMsIndividualStyles()
get number of learning modules with individual styles
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ executeCommand()

ilContentStyleSettingsGUI::executeCommand ( )

Definition at line 73 of file class.ilContentStyleSettingsGUI.php.

References ILIAS\Repository\ctrl(), and getImportForm().

73  : void
74  {
75  $next_class = $this->ctrl->getNextClass($this);
76  $cmd = $this->ctrl->getCmd("edit");
77 
78  switch ($next_class) {
79  case "ilobjstylesheetgui":
80  $this->ctrl->setReturn($this, "edit");
81  $style_gui = new ilObjStyleSheetGUI("", $this->obj_id, false);
82  $this->ctrl->forwardCommand($style_gui);
83  break;
84 
85  case strtolower(ilRepoStandardUploadHandlerGUI::class):
86  $form = $this->getImportForm();
87  $gui = $form->getRepoStandardUploadHandlerGUI("import_file");
88  $this->ctrl->forwardCommand($gui);
89  break;
90 
91 
92  default:
93  $this->parent_gui->prepareOutput();
94  if (in_array($cmd, array("edit",
95  "delete",
96  "toggleGlobalDefault",
97  "toggleGlobalFixed",
98  "setScope",
99  "saveScope",
100  "saveActiveStyles",
101  "createStyle",
102  "moveLMStyles",
103  "moveIndividualStyles",
104  "deleteStyle",
105  "cancelDelete",
106  "confirmedDelete",
107  "import"
108  ))) {
109  $this->$cmd();
110  } else {
111  die("Unknown command " . $cmd);
112  }
113  }
114  }
+ Here is the call graph for this function:

◆ getImportForm()

ilContentStyleSettingsGUI::getImportForm ( )
protected

Definition at line 224 of file class.ilContentStyleSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by executeCommand(), and import().

225  {
226  $gui = new ilObjStyleSheetGUI("", 0, false);
227  return $this->gui->form([self::class], "import")
228  ->file(
229  "import_file",
230  $this->lng->txt("import"),
231  $gui->handleImport(...), // Placeholder for upload handler
232  "obj_id",
233  "",
234  1,
235  ["application/zip"]
236  );
237  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ import()

ilContentStyleSettingsGUI::import ( )

Definition at line 239 of file class.ilContentStyleSettingsGUI.php.

References ilObjStyleSheet\_writeStandard(), ILIAS\Repository\ctrl(), getImportForm(), ilObjectFactory\getInstanceByRefId(), and ILIAS\Repository\int().

239  : void
240  {
241  $form = $this->getImportForm();
242  if ($form->isValid()) {
243  if ($this->request->getRefId() > 0) {
244  $fold = ilObjectFactory::getInstanceByRefId($this->request->getRefId());
245  if ($fold->getType() == "stys") {
246  $obj_id = (int) $form->getData("import_file");
247  $cont_style_settings = new ilContentStyleSettings();
248  $cont_style_settings->addStyle($obj_id);
249  $cont_style_settings->update();
251  $this->ctrl->redirectByClass(self::class, "");
252  }
253  }
254  }
255  }
static _writeStandard(int $a_id, bool $a_std)
Write standard flag.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:

◆ moveIndividualStyles()

ilContentStyleSettingsGUI::moveIndividualStyles ( )

move all learning modules with individual styles to new style

Definition at line 280 of file class.ilContentStyleSettingsGUI.php.

References ilObjContentObject\_moveLMStyles(), checkPermission(), and ILIAS\Repository\ctrl().

280  : void
281  {
282  $this->checkPermission("sty_write_content");
283 
284  ilObjContentObject::_moveLMStyles(-1, $this->request->getToStyleId());
285  $this->ctrl->redirect($this, "edit");
286  }
static _moveLMStyles(int $a_from_style, int $a_to_style)
move learning modules from one style to another
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ moveLMStyles()

ilContentStyleSettingsGUI::moveLMStyles ( )

move learning modules from one style to another

Definition at line 261 of file class.ilContentStyleSettingsGUI.php.

References ilObjContentObject\_moveLMStyles(), checkPermission(), confirmDeleteIndividualStyles(), and ILIAS\Repository\ctrl().

261  : void
262  {
263  $this->checkPermission("sty_write_content");
264 
265  if ($this->request->getFromStyleId() == -1) {
267  return;
268  }
269 
271  $this->request->getFromStyleId(),
272  $this->request->getToStyleId()
273  );
274  $this->ctrl->redirect($this, "edit");
275  }
static _moveLMStyles(int $a_from_style, int $a_to_style)
move learning modules from one style to another
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ saveActiveStyles()

ilContentStyleSettingsGUI::saveActiveStyles ( )

Definition at line 402 of file class.ilContentStyleSettingsGUI.php.

References ilObjStyleSheet\_writeActive(), ILIAS\Repository\ctrl(), and ilUtil\redirect().

402  : void
403  {
404  $styles = $this->cs_settings->getStyles();
405  foreach ($styles as $style) {
406  if ($this->request->getSelectedStandard($style["id"]) == 1) {
407  ilObjStyleSheet::_writeActive((int) $style["id"], true);
408  } else {
409  ilObjStyleSheet::_writeActive((int) $style["id"], false);
410  }
411  }
412  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
413  }
static _writeActive(int $a_id, bool $a_active)
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ saveScope()

ilContentStyleSettingsGUI::saveScope ( )

Definition at line 482 of file class.ilContentStyleSettingsGUI.php.

References $tree, ilObjStyleSheet\_writeScope(), checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilTree\readRootId(), and ilUtil\redirect().

482  : void
483  {
484  $tree = $this->tree;
485 
486  $this->checkPermission("sty_write_content");
487 
488  $cat_id = $this->request->getCatId();
489  if ($cat_id == $tree->readRootId()) {
490  $cat_id = 0;
491  }
492 
493  ilObjStyleSheet::_writeScope($this->request->getId(), $cat_id);
494 
495  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
496 
497  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
498  }
static _writeScope(int $a_id, int $a_scope)
static redirect(string $a_script)
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ setScope()

ilContentStyleSettingsGUI::setScope ( )

Definition at line 461 of file class.ilContentStyleSettingsGUI.php.

References $ctrl, $tpl, checkPermission(), and ILIAS\UICore\GlobalTemplate\setContent().

461  : void
462  {
463  $tpl = $this->tpl;
464  $ilCtrl = $this->ctrl;
465 
466  $this->checkPermission("sty_write_content");
467 
468  $ilCtrl->saveParameter($this, "id");
470  $this,
471  "setScope",
472  $this,
473  "saveScope",
474  "cat"
475  );
476  $exp->setTypeWhiteList(array("root", "cat"));
477  if (!$exp->handleCommand()) {
478  $tpl->setContent($exp->getHTML());
479  }
480  }
setContent(string $a_html)
Sets content for standard template.
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ showActions()

ilContentStyleSettingsGUI::showActions ( bool  $with_subobjects = false)

show possible action (form buttons)

Definition at line 418 of file class.ilContentStyleSettingsGUI.php.

References ilUtil\getImagePath(), and ILIAS\Repository\lng().

418  : void
419  {
420  // delete
421  $this->tpl->setCurrentBlock("tbl_action_btn");
422  $this->tpl->setVariable("BTN_NAME", "deleteStyle");
423  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
424  $this->tpl->parseCurrentBlock();
425 
426  // set global default
427  $this->tpl->setCurrentBlock("tbl_action_btn");
428  $this->tpl->setVariable("BTN_NAME", "toggleGlobalDefault");
429  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalDefault"));
430  $this->tpl->parseCurrentBlock();
431 
432  // set global default
433  $this->tpl->setCurrentBlock("tbl_action_btn");
434  $this->tpl->setVariable("BTN_NAME", "toggleGlobalFixed");
435  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalFixed"));
436  $this->tpl->parseCurrentBlock();
437 
438  // set global default
439  $this->tpl->setCurrentBlock("tbl_action_btn");
440  $this->tpl->setVariable("BTN_NAME", "setScope");
441  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("sty_set_scope"));
442  $this->tpl->parseCurrentBlock();
443 
444  // save active styles
445  $this->tpl->setCurrentBlock("tbl_action_btn");
446  $this->tpl->setVariable("BTN_NAME", "saveActiveStyles");
447  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("sty_save_active_styles"));
448  $this->tpl->parseCurrentBlock();
449 
450  $this->tpl->setCurrentBlock("tbl_action_row");
451  $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("nav/arrow_downright.svg"));
452  $this->tpl->parseCurrentBlock();
453  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ toggleGlobalDefault()

ilContentStyleSettingsGUI::toggleGlobalDefault ( )

Toggle global default style.

Definition at line 358 of file class.ilContentStyleSettingsGUI.php.

References $ilSetting, $lng, $settings, checkPermission(), ILIAS\Repository\ctrl(), ilUtil\redirect(), and ilLanguage\txt().

358  : void
359  {
361  $lng = $this->lng;
362 
363  $this->checkPermission("sty_write_content");
364 
365  if ($this->request->getId() > 0) {
366  $ilSetting->delete("fixed_content_style_id");
367  $def_style = $ilSetting->get("default_content_style_id");
368 
369  if ($def_style != $this->request->getId()) {
370  $ilSetting->set("default_content_style_id", (string) $this->request->getId());
371  } else {
372  $ilSetting->delete("default_content_style_id");
373  }
374  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
375  }
376  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
377  }
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...
static redirect(string $a_script)
global $ilSetting
Definition: privfeed.php:31
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

◆ toggleGlobalFixed()

ilContentStyleSettingsGUI::toggleGlobalFixed ( )

Toggle global fixed style.

Definition at line 382 of file class.ilContentStyleSettingsGUI.php.

References $ilSetting, $lng, $settings, checkPermission(), ILIAS\Repository\ctrl(), ilUtil\redirect(), and ilLanguage\txt().

382  : void
383  {
385  $lng = $this->lng;
386 
387  $this->checkPermission("sty_write_content");
388 
389  if ($this->request->getId() > 0) {
390  $ilSetting->delete("default_content_style_id");
391  $fixed_style = $ilSetting->get("fixed_content_style_id");
392  if ($fixed_style == $this->request->getId()) {
393  $ilSetting->delete("fixed_content_style_id");
394  } else {
395  $ilSetting->set("fixed_content_style_id", (string) $this->request->getId());
396  }
397  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
398  }
399  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
400  }
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...
static redirect(string $a_script)
global $ilSetting
Definition: privfeed.php:31
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
+ Here is the call graph for this function:

Field Documentation

◆ $cs_settings

ilContentStyleSettings ilContentStyleSettingsGUI::$cs_settings
protected

Definition at line 34 of file class.ilContentStyleSettingsGUI.php.

◆ $ctrl

ilCtrl ilContentStyleSettingsGUI::$ctrl
protected

Definition at line 40 of file class.ilContentStyleSettingsGUI.php.

Referenced by createStyle(), and setScope().

◆ $DIC

ILIAS DI Container ilContentStyleSettingsGUI::$DIC
protected

Definition at line 45 of file class.ilContentStyleSettingsGUI.php.

Referenced by __construct().

◆ $gui

InternalGUIService ilContentStyleSettingsGUI::$gui
protected

Definition at line 33 of file class.ilContentStyleSettingsGUI.php.

◆ $lng

ilLanguage ilContentStyleSettingsGUI::$lng
protected

Definition at line 43 of file class.ilContentStyleSettingsGUI.php.

Referenced by toggleGlobalDefault(), and toggleGlobalFixed().

◆ $obj_id

int ilContentStyleSettingsGUI::$obj_id
protected

Definition at line 36 of file class.ilContentStyleSettingsGUI.php.

◆ $parent_gui

ilObjStyleSettingsGUI ilContentStyleSettingsGUI::$parent_gui
protected

Definition at line 35 of file class.ilContentStyleSettingsGUI.php.

◆ $rbacsystem

ilRbacSystem ilContentStyleSettingsGUI::$rbacsystem
protected

Definition at line 41 of file class.ilContentStyleSettingsGUI.php.

◆ $ref_id

int ilContentStyleSettingsGUI::$ref_id
protected

Definition at line 46 of file class.ilContentStyleSettingsGUI.php.

◆ $request

StandardGUIRequest ilContentStyleSettingsGUI::$request
protected

Definition at line 37 of file class.ilContentStyleSettingsGUI.php.

◆ $settings

ilSetting ilContentStyleSettingsGUI::$settings
protected

Definition at line 38 of file class.ilContentStyleSettingsGUI.php.

Referenced by toggleGlobalDefault(), and toggleGlobalFixed().

◆ $toolbar

ilToolbarGUI ilContentStyleSettingsGUI::$toolbar
protected

Definition at line 42 of file class.ilContentStyleSettingsGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilContentStyleSettingsGUI::$tpl
protected

Definition at line 44 of file class.ilContentStyleSettingsGUI.php.

Referenced by setScope().

◆ $tree

ilTree ilContentStyleSettingsGUI::$tree
protected

Definition at line 39 of file class.ilContentStyleSettingsGUI.php.

Referenced by saveScope().


The documentation for this class was generated from the following file: