3 declare(strict_types=1);
39 $this->
ctrl = $DIC->ctrl();
40 $this->
lng = $DIC->language();
42 $this->rbacsystem = $DIC->rbac()->system();
43 $ilCtrl = $DIC->ctrl();
44 $lng = $DIC->language();
47 $this->fixed_style = (
int)
$ilSetting->get(
"fixed_content_style_id");
48 $this->default_style = (
int)
$ilSetting->get(
"default_content_style_id");
50 $this->
setId(
"sty_cs");
58 $this->
addColumn($this->
lng->txt(
"sty_nr_learning_modules"));
65 $this->
setRowTemplate(
"tpl.content_style_row.html",
"Services/Style/Content");
66 if ($this->parent_obj->checkPermission(
"sty_write_content",
false)) {
75 protected function fillRow(array $a_set): void
80 if ($a_set[
"id"] > 0) {
81 $this->tpl->setCurrentBlock(
"cb");
82 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
83 $this->tpl->parseCurrentBlock();
85 $this->tpl->setCurrentBlock(
"cb_act");
86 if ($a_set[
"active"]) {
87 $this->tpl->setVariable(
"ACT_CHECKED",
"checked='checked'");
89 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
90 $this->tpl->parseCurrentBlock();
92 $this->tpl->setCurrentBlock(
"edit_link");
94 $this->tpl->setVariable(
"EDIT_LINK", $ilCtrl->getLinkTargetByClass(
"ilobjstylesheetgui",
""));
95 $ilCtrl->setParameterByClass(
"ilobjstylesheetgui",
"obj_id",
"");
96 $this->tpl->setVariable(
"EDIT_TITLE", $a_set[
"title"]);
97 $this->tpl->parseCurrentBlock();
99 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
102 $ilCtrl->setParameter($this->parent_obj,
"id", $a_set[
"id"]);
103 if ($a_set[
"id"] > 0 && $this->parent_obj->checkPermission(
"sty_write_content",
false)) {
105 $list->setListTitle(
$lng->
txt(
"actions"));
106 $list->setId(
"sty_act_" . $a_set[
"id"]);
109 if ($this->default_style == $a_set[
"id"]) {
111 $lng->
txt(
"sty_remove_global_default_state"),
113 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalDefault")
115 } elseif ($a_set[
"active"]) {
117 $lng->
txt(
"sty_make_global_default"),
119 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalDefault")
124 if ($this->fixed_style == $a_set[
"id"]) {
126 $lng->
txt(
"sty_remove_global_fixed_state"),
128 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalFixed")
130 } elseif ($a_set[
"active"]) {
132 $lng->
txt(
"sty_make_global_fixed"),
134 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalFixed")
140 $ilCtrl->getLinkTarget($this->parent_obj,
"setScope")
143 $this->tpl->setVariable(
"ACTIONS", $list->getHTML());
145 if ($a_set[
"id"] == $this->fixed_style) {
146 $this->tpl->setVariable(
"PURPOSE",
$lng->
txt(
"global_fixed"));
148 if ($a_set[
"id"] == $this->default_style) {
149 $this->tpl->setVariable(
"PURPOSE",
$lng->
txt(
"global_default"));
152 $ilCtrl->setParameter($this->parent_obj,
"id",
"");
154 $this->tpl->setVariable(
"NR_LM", $a_set[
"lm_nr"]);
155 if (($a_set[
"category"] ?? 0) > 0) {
156 $this->tpl->setVariable(
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
__construct(ilContentStyleSettingsGUI $a_parent_obj, string $a_parent_cmd, array $a_data)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
fillRow(array $a_set)
Fill table row.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
addMultiCommand(string $a_cmd, string $a_text)
Settings UI class for system styles.