ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilStyleColorTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
34
35 public function __construct(
36 object $a_parent_obj,
37 string $a_parent_cmd,
38 ilObjStyleSheet $a_style_obj,
40 ) {
41 global $DIC;
42
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->access = $DIC->access();
46 $this->rbacsystem = $DIC->rbac()->system();
47 $ilCtrl = $DIC->ctrl();
48 $lng = $DIC->language();
49 $this->access_manager = $access_manager;
50
51 parent::__construct($a_parent_obj, $a_parent_cmd);
52
53 $this->setTitle($lng->txt("sty_colors"));
54 $this->setDescription($lng->txt("sty_color_info"));
55 $this->style_obj = $a_style_obj;
56
57 $this->addColumn("", "", "1"); // checkbox
58 $this->addColumn($this->lng->txt("sty_color_name"));
59 $this->addColumn($this->lng->txt("sty_color_code"));
60 $this->addColumn($this->lng->txt("sty_color"));
61 $this->addColumn($this->lng->txt("sty_color_flavors"));
62 $this->addColumn($this->lng->txt("sty_commands"), "", "1");
63 $this->setEnableHeader(true);
64 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
65 $this->setRowTemplate("tpl.style_color_row.html", "components/ILIAS/Style/Content");
66 //$this->setSelectAllCheckbox("file");
67 $this->getItems();
68
69 // action commands
70 if ($this->access_manager->checkWrite()) {
71 $this->addMultiCommand("deleteColorConfirmation", $lng->txt("delete"));
72 }
73
74 $this->setEnableTitle(true);
75 }
76
77 public function getItems(): void
78 {
79 $this->setData($this->style_obj->getColors());
80 }
81
82 protected function fillRow(array $a_set): void
83 {
85 $ilCtrl = $this->ctrl;
86
87 for ($i = -80; $i <= 80; $i += 20) {
88 $this->tpl->setCurrentBlock("flavor");
89 $this->tpl->setVariable("FLAVOR_NAME", "(" . $i . ")");
90 $this->tpl->setVariable(
91 "FLAVOR_CODE",
92 ilObjStyleSheet::_getColorFlavor($a_set["code"], $i)
93 );
94 $this->tpl->parseCurrentBlock();
95 }
96
97 $this->tpl->setVariable("COLOR_NAME_ENC", ilLegacyFormElementsUtil::prepareFormOutput($a_set["name"]));
98 $this->tpl->setVariable("COLOR_NAME", $a_set["name"]);
99 $this->tpl->setVariable("COLOR_CODE", $a_set["code"]);
100
101 if ($this->access_manager->checkWrite()) {
102 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
103 $ilCtrl->setParameter($this->parent_obj, "c_name", rawurlencode($a_set["name"]));
104 $this->tpl->setVariable(
105 "LINK_EDIT_COLOR",
106 $ilCtrl->getLinkTarget($this->parent_obj, "editColor")
107 );
108 }
109 }
110}
Manages access to content style editing.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
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 prepareFormOutput($a_str, bool $a_strip=false)
Class ilObjStyleSheet.
static _getColorFlavor(string $a_rgb, int $a_i)
Get color flavor.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
TableGUI class for style editor (image list)
__construct(object $a_parent_obj, string $a_parent_cmd, ilObjStyleSheet $a_style_obj, Content\Access\StyleAccessManager $access_manager)
Content Access StyleAccessManager $access_manager
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableTitle(bool $a_enabletitle)
setDescription(string $a_val)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setEnableHeader(bool $a_enableheader)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26