19 declare(strict_types=1);
27 protected \ILIAS\Style\Content\InternalGUIService
$gui;
40 $this->
ctrl = $DIC->ctrl();
41 $this->
lng = $DIC->language();
43 $this->rbacsystem = $DIC->rbac()->system();
44 $ilCtrl = $DIC->ctrl();
45 $lng = $DIC->language();
47 $this->gui = $DIC->contentStyle()
51 $this->fixed_style = (
int)
$ilSetting->get(
"fixed_content_style_id");
52 $this->default_style = (
int)
$ilSetting->get(
"default_content_style_id");
54 $this->
setId(
"sty_cs");
62 $this->
addColumn($this->
lng->txt(
"sty_nr_learning_modules"));
69 $this->
setRowTemplate(
"tpl.content_style_row.html",
"components/ILIAS/Style/Content");
70 if ($this->parent_obj->checkPermission(
"sty_write_content",
false)) {
79 protected function fillRow(array $a_set): void
83 $ui_factory = $this->gui->ui()->factory();
84 $ui_renderer = $this->gui->ui()->renderer();
86 if ($a_set[
"id"] > 0) {
87 $this->tpl->setCurrentBlock(
"cb");
88 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
89 $this->tpl->parseCurrentBlock();
91 $this->tpl->setCurrentBlock(
"cb_act");
92 if ($a_set[
"active"]) {
93 $this->tpl->setVariable(
"ACT_CHECKED",
"checked='checked'");
95 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
96 $this->tpl->parseCurrentBlock();
98 $this->tpl->setCurrentBlock(
"edit_link");
100 $this->tpl->setVariable(
"EDIT_LINK", $ilCtrl->getLinkTargetByClass(
"ilobjstylesheetgui",
""));
101 $ilCtrl->setParameterByClass(
"ilobjstylesheetgui",
"obj_id",
"");
102 $this->tpl->setVariable(
"EDIT_TITLE", $a_set[
"title"]);
103 $this->tpl->parseCurrentBlock();
105 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
108 $ilCtrl->setParameter($this->parent_obj,
"id", $a_set[
"id"]);
109 if ($a_set[
"id"] > 0 && $this->parent_obj->checkPermission(
"sty_write_content",
false)) {
113 if ($this->default_style == $a_set[
"id"]) {
114 $actions[] = $ui_factory->link()->standard(
115 $lng->
txt(
"sty_remove_global_default_state"),
116 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalDefault")
118 } elseif ($a_set[
"active"]) {
119 $actions[] = $ui_factory->link()->standard(
120 $lng->
txt(
"sty_make_global_default"),
121 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalDefault")
126 if ($this->fixed_style == $a_set[
"id"]) {
127 $actions[] = $ui_factory->link()->standard(
128 $lng->
txt(
"sty_remove_global_fixed_state"),
129 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalFixed")
131 } elseif ($a_set[
"active"]) {
132 $actions[] = $ui_factory->link()->standard(
133 $lng->
txt(
"sty_make_global_fixed"),
134 $ilCtrl->getLinkTarget($this->parent_obj,
"toggleGlobalFixed")
137 $actions[] = $ui_factory->link()->standard(
139 $ilCtrl->getLinkTarget($this->parent_obj,
"setScope")
142 $dd = $ui_factory->dropdown()->standard($actions);
144 $this->tpl->setVariable(
"ACTIONS", $ui_renderer->render($dd));
146 if ($a_set[
"id"] == $this->fixed_style) {
147 $this->tpl->setVariable(
"PURPOSE",
$lng->
txt(
"global_fixed"));
149 if ($a_set[
"id"] == $this->default_style) {
150 $this->tpl->setVariable(
"PURPOSE",
$lng->
txt(
"global_default"));
153 $ilCtrl->setParameter($this->parent_obj,
"id",
"");
155 $this->tpl->setVariable(
"NR_LM", $a_set[
"lm_nr"]);
156 if (($a_set[
"category"] ?? 0) > 0) {
157 $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)
ILIAS Style Content InternalGUIService $gui
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.