ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 454 of file class.ilContentStyleSettingsGUI.php.

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

454  : void
455  {
456  $this->tpl->setOnScreenMessage('info', $this->lng->txt("msg_cancel"), true);
457  $this->ctrl->redirect($this, "edit");
458  }
+ 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 287 of file class.ilContentStyleSettingsGUI.php.

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

Referenced by moveLMStyles().

287  : void
288  {
289  $this->checkPermission("sty_write_content");
290 
291  $this->ctrl->setParameter($this, "to_style", $this->request->getToStyleId());
292 
293  $cgui = new ilConfirmationGUI();
294  $cgui->setFormAction($this->ctrl->getFormAction($this));
295  $cgui->setHeaderText($this->lng->txt("sty_confirm_del_ind_styles") . ": " .
296  sprintf(
297  $this->lng->txt("sty_confirm_del_ind_styles_desc"),
298  ilObject::_lookupTitle($this->request->getToStyleId())
299  ));
300  $cgui->setCancel($this->lng->txt("cancel"), "edit");
301  $cgui->setConfirm($this->lng->txt("ok"), "moveIndividualStyles");
302  $this->tpl->setContent($cgui->getHTML());
303  }
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 337 of file class.ilContentStyleSettingsGUI.php.

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

337  : void
338  {
339  $this->checkPermission("sty_write_content");
340 
341  $ids = $this->request->getIds();
342  foreach ($ids as $id) {
343  $set = new ilContentStyleSettings();
344  $set->removeStyle($id);
345  $set->update();
346 
347  $style_obj = ilObjectFactory::getInstanceByObjId($id);
348  $style_obj->delete();
349  }
350 
351  $this->ctrl->redirect($this, "edit");
352  }
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 308 of file class.ilContentStyleSettingsGUI.php.

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

308  : void
309  {
310  $this->checkPermission("sty_write_content");
311 
312  $ids = $this->request->getIds();
313  if (count($ids) == 0) {
314  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
315  $this->ctrl->redirect($this, "edit");
316  }
317 
318  // display confirmation message
319  $cgui = new ilConfirmationGUI();
320  $cgui->setFormAction($this->ctrl->getFormAction($this));
321  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
322  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
323  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
324 
325  foreach ($ids as $id) {
326  $caption = ilObject::_lookupTitle($id);
327 
328  $cgui->addItem("id[]", (string) $id, $caption);
329  }
330 
331  $this->tpl->setContent($cgui->getHTML());
332  }
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\form(), getImportForm(), 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  $modal = $this->gui->modal($this->lng->txt("import"))
195  ->form($this->getImportForm());
196  $modal_c = $modal->getTriggerButtonComponents($this->lng->txt("import"), false);
197  $this->toolbar->addComponent($modal_c["button"]);
198  $rendered_modal = $this->gui->ui()->renderer()->render($modal_c["modal"]);
199 
200  $this->toolbar->addSeparator();
201 
202  // from styles selector
203  $si = new ilSelectInputGUI(
204  $this->lng->txt("sty_move_lm_styles") . ": " . $this->lng->txt("sty_from"),
205  "from_style"
206  );
207  $si->setOptions($from_styles);
208  $this->toolbar->addInputItem($si, true);
209 
210  // from styles selector
211  $si = new ilSelectInputGUI($this->lng->txt("sty_to"), "to_style");
212  $si->setOptions($to_styles);
213  $this->toolbar->addInputItem($si, true);
214  $this->toolbar->addFormButton($this->lng->txt("sty_move_style"), "moveLMStyles");
215 
216  $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
217  }
218 
219  $table = new ilContentStylesTableGUI($this, "edit", $data);
220  $this->tpl->setContent($table->getHTML() . $rendered_modal);
221  }
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.
form( $class_path, string $cmd, string $submit_caption="")
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 223 of file class.ilContentStyleSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by edit(), executeCommand(), and import().

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

◆ import()

ilContentStyleSettingsGUI::import ( )

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

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

238  : void
239  {
240  $form = $this->getImportForm();
241  if ($form->isValid()) {
242  if ($this->request->getRefId() > 0) {
243  $fold = ilObjectFactory::getInstanceByRefId($this->request->getRefId());
244  if ($fold->getType() == "stys") {
245  $obj_id = (int) $form->getData("import_file");
246  $cont_style_settings = new ilContentStyleSettings();
247  $cont_style_settings->addStyle($obj_id);
248  $cont_style_settings->update();
250  $this->ctrl->redirectByClass(self::class, "");
251  }
252  }
253  }
254  }
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 279 of file class.ilContentStyleSettingsGUI.php.

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

279  : void
280  {
281  $this->checkPermission("sty_write_content");
282 
283  ilObjContentObject::_moveLMStyles(-1, $this->request->getToStyleId());
284  $this->ctrl->redirect($this, "edit");
285  }
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 260 of file class.ilContentStyleSettingsGUI.php.

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

260  : void
261  {
262  $this->checkPermission("sty_write_content");
263 
264  if ($this->request->getFromStyleId() == -1) {
266  return;
267  }
268 
270  $this->request->getFromStyleId(),
271  $this->request->getToStyleId()
272  );
273  $this->ctrl->redirect($this, "edit");
274  }
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 401 of file class.ilContentStyleSettingsGUI.php.

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

401  : void
402  {
403  $styles = $this->cs_settings->getStyles();
404  foreach ($styles as $style) {
405  if ($this->request->getSelectedStandard($style["id"]) == 1) {
406  ilObjStyleSheet::_writeActive((int) $style["id"], true);
407  } else {
408  ilObjStyleSheet::_writeActive((int) $style["id"], false);
409  }
410  }
411  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
412  }
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 481 of file class.ilContentStyleSettingsGUI.php.

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

481  : void
482  {
483  $tree = $this->tree;
484 
485  $this->checkPermission("sty_write_content");
486 
487  $cat_id = $this->request->getCatId();
488  if ($cat_id == $tree->readRootId()) {
489  $cat_id = 0;
490  }
491 
492  ilObjStyleSheet::_writeScope($this->request->getId(), $cat_id);
493 
494  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
495 
496  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
497  }
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 460 of file class.ilContentStyleSettingsGUI.php.

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

460  : void
461  {
462  $tpl = $this->tpl;
463  $ilCtrl = $this->ctrl;
464 
465  $this->checkPermission("sty_write_content");
466 
467  $ilCtrl->saveParameter($this, "id");
469  $this,
470  "setScope",
471  $this,
472  "saveScope",
473  "cat"
474  );
475  $exp->setTypeWhiteList(array("root", "cat"));
476  if (!$exp->handleCommand()) {
477  $tpl->setContent($exp->getHTML());
478  }
479  }
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 417 of file class.ilContentStyleSettingsGUI.php.

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

417  : void
418  {
419  // delete
420  $this->tpl->setCurrentBlock("tbl_action_btn");
421  $this->tpl->setVariable("BTN_NAME", "deleteStyle");
422  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
423  $this->tpl->parseCurrentBlock();
424 
425  // set global default
426  $this->tpl->setCurrentBlock("tbl_action_btn");
427  $this->tpl->setVariable("BTN_NAME", "toggleGlobalDefault");
428  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalDefault"));
429  $this->tpl->parseCurrentBlock();
430 
431  // set global default
432  $this->tpl->setCurrentBlock("tbl_action_btn");
433  $this->tpl->setVariable("BTN_NAME", "toggleGlobalFixed");
434  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalFixed"));
435  $this->tpl->parseCurrentBlock();
436 
437  // set global default
438  $this->tpl->setCurrentBlock("tbl_action_btn");
439  $this->tpl->setVariable("BTN_NAME", "setScope");
440  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("sty_set_scope"));
441  $this->tpl->parseCurrentBlock();
442 
443  // save active styles
444  $this->tpl->setCurrentBlock("tbl_action_btn");
445  $this->tpl->setVariable("BTN_NAME", "saveActiveStyles");
446  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("sty_save_active_styles"));
447  $this->tpl->parseCurrentBlock();
448 
449  $this->tpl->setCurrentBlock("tbl_action_row");
450  $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("nav/arrow_downright.svg"));
451  $this->tpl->parseCurrentBlock();
452  }
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 357 of file class.ilContentStyleSettingsGUI.php.

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

357  : void
358  {
360  $lng = $this->lng;
361 
362  $this->checkPermission("sty_write_content");
363 
364  if ($this->request->getId() > 0) {
365  $ilSetting->delete("fixed_content_style_id");
366  $def_style = $ilSetting->get("default_content_style_id");
367 
368  if ($def_style != $this->request->getId()) {
369  $ilSetting->set("default_content_style_id", (string) $this->request->getId());
370  } else {
371  $ilSetting->delete("default_content_style_id");
372  }
373  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
374  }
375  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
376  }
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 381 of file class.ilContentStyleSettingsGUI.php.

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

381  : void
382  {
384  $lng = $this->lng;
385 
386  $this->checkPermission("sty_write_content");
387 
388  if ($this->request->getId() > 0) {
389  $ilSetting->delete("default_content_style_id");
390  $fixed_style = $ilSetting->get("fixed_content_style_id");
391  if ($fixed_style == $this->request->getId()) {
392  $ilSetting->delete("fixed_content_style_id");
393  } else {
394  $ilSetting->set("fixed_content_style_id", (string) $this->request->getId());
395  }
396  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
397  }
398  ilUtil::redirect($this->ctrl->getLinkTarget($this, "edit", ""));
399  }
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: