19 declare(strict_types=1);
30 public function __construct(
object $a_parent_obj,
string $a_parent_cmd =
'')
36 $this->
setTitle($this->
lng->txt(
'manage_system_styles'));
38 $this->
addColumn($this->
lng->txt(
'style_name'),
'style_name');
39 $this->
addColumn($this->
lng->txt(
'skin_name'),
'skin_name');
46 $this->
setRowTemplate(
'tpl.sys_styles_row.html',
'Services/Style/System');
54 public function addActions($management_enabled,
bool $read_documentation =
true)
61 $this->
setRowTemplate(
'tpl.sys_styles_row_with_actions.html',
'Services/Style/System');
63 if ($read_documentation || $management_enabled) {
68 if ($management_enabled) {
83 $users_missing_styles = 0;
84 foreach ($all_user_styles as $skin_style_id) {
85 $style_arr = explode(
':', $skin_style_id);
91 if ($users_missing_styles > 0) {
92 $all_styles[
'other'] =
94 'title' => $this->
lng->txt(
'other'),
99 'skin_name' =>
'other',
101 'users' => $users_missing_styles,
113 protected function fillRow(array $a_set): void
117 $this->tpl->setVariable(
'STYLE_NAME', $a_set[
'style_name']);
118 $this->tpl->setVariable(
'SKIN_NAME', $a_set[
'skin_name']);
119 $is_substyle = isset($a_set[
'substyle_of']) && $a_set[
'substyle_of'] !=
'';
122 $this->tpl->setVariable(
'USERS', $a_set[
'users']);
124 $this->tpl->setVariable(
'USERS',
'-');
127 if ($a_set[
'id'] !=
'other') {
128 $this->tpl->setCurrentBlock(
'default_input');
131 $this->tpl->setVariable(
'DEFAULT_ID', $a_set[
'id']);
135 $this->tpl->setVariable(
'CHECKED_DEFAULT',
" checked='checked' ");
137 $this->tpl->setVariable(
'CHECKED_DEFAULT');
139 $this->tpl->parseCurrentBlock();
142 $this->tpl->setCurrentBlock(
'active_input');
143 $this->tpl->setVariable(
'ACTIVE_ID', $a_set[
'id']);
146 $this->tpl->setVariable(
'DISABLED_ACTIVE',
'disabled');
149 $this->tpl->setVariable(
'CHECKED_ACTIVE',
" checked='checked' ");
151 $this->tpl->setVariable(
'CHECKED_ACTIVE');
154 $this->tpl->setVariable(
'CHECKED_ACTIVE',
" checked='checked' ");
156 $this->tpl->setVariable(
'CHECKED_ACTIVE');
159 $this->tpl->parseCurrentBlock();
163 $this->tpl->setVariable(
'SUB_STYLE_OF', $a_set[
'substyle_of_name']);
167 $a_set[
'substyle_of'],
173 foreach ($assignments as $assignment) {
175 if ($category_title) {
176 $categories[] = $category_title;
180 $listing = $DIC->ui()->factory()->listing()->unordered($categories);
181 $this->tpl->setVariable(
183 $this->
lng->txt(
'local') . $DIC->ui()->renderer()->render($listing)
186 $this->tpl->setVariable(
'SUB_STYLE_OF');
187 $this->tpl->setVariable(
'CATEGORIES', $this->
lng->txt(
'global'));
190 $this->tpl->setVariable(
'VERSION', $a_set[
'version']);
194 if ($a_set[
'skin_id'] ==
'other') {
195 $this->tpl->setCurrentBlock(
'actions');
196 $this->tpl->setVariable(
'ACTIONS');
197 $this->tpl->parseCurrentBlock();
200 $action_list->setId(
'id_action_list_' . $a_set[
'id']);
201 $action_list->setListTitle($this->
lng->txt(
'actions'));
204 $DIC->ctrl()->setParameterByClass(
'ilSystemStyleDocumentationGUI',
'skin_id', $a_set[
'skin_id']);
205 $DIC->ctrl()->setParameterByClass(
'ilSystemStyleDocumentationGUI',
'style_id', $a_set[
'style_id']);
206 $action_list->addItem(
207 $this->
lng->txt(
'open_documentation'),
209 $this->
ctrl->getLinkTargetByClass(
'ilSystemStyleDocumentationGUI',
'entries')
214 $this->
ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'skin_id', $a_set[
'skin_id']);
215 $this->
ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'style_id', $a_set[
'style_id']);
217 $this->
ctrl->setParameterByClass(
'ilSystemStyleOverviewGUI',
'skin_id', $a_set[
'skin_id']);
218 $this->
ctrl->setParameterByClass(
'ilSystemStyleOverviewGUI',
'style_id', $a_set[
'style_id']);
221 if ($a_set[
'skin_id'] !=
$config->getDefaultSkinId()) {
225 if (!$is_substyle && $a_set[
'skin_id'] !=
'default') {
226 $action_list->addItem(
227 $this->
lng->txt(
'export'),
229 $this->
ctrl->getLinkTargetByClass(
'ilSystemStyleOverviewGUI',
'export')
234 $this->tpl->setCurrentBlock(
'actions');
235 $this->tpl->setVariable(
'ACTIONS', $action_list->getHTML());
236 $this->tpl->parseCurrentBlock();
244 $this->
lng->txt(
'edit'),
246 $this->
ctrl->getLinkTargetByClass(
'ilSystemStyleSettingsGUI')
249 $this->
lng->txt(
'delete'),
251 $this->
ctrl->getLinkTargetByClass(
'ilSystemStyleOverviewGUI',
'deleteStyle')
257 $this->tpl->setCurrentBlock(
'multi_actions');
258 $this->tpl->setVariable(
'MULTI_ACTIONS_ID',
$id);
259 $this->tpl->parseCurrentBlock();
static _lookupActivatedStyle(string $a_skin, string $a_style)
lookup if a style is activated
setFormAction(string $a_form_action, bool $a_multipart=false)
static styleExists(string $style_id)
static getCurrentDefaultSkin()
Gets default Skin of the System.
addManagementActionsToList(ilAdvancedSelectionListGUI $action_list)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
addItem(string $a_title, string $a_value="", string $a_link="", string $a_img="", string $a_alt="", string $a_frame="", string $a_html="", bool $a_prevent_background_click=false, string $a_onclick="", string $a_ttip="", string $a_tt_my="right center", string $a_tt_at="left center", bool $a_tt_use_htmlspecialchars=true, array $a_data=array())
static _lookupObjId(int $ref_id)
static _getNumberOfUsersForStyle(string $a_skin, string $a_style)
addActions($management_enabled, bool $read_documentation=true)
static getAllSkinStyles()
Get all skins/styles as array (convenient for tables) Attention: tempalte_name/template_id in this ar...
static _lookupTitle(int $obj_id)
setManagementEnabled(bool $management_enabled)
static getSubStyleCategoryAssignments(string $a_skin_id, string $a_style_id, string $a_sub_style_id)
Get all system category assignments of exactly one substyle.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
setReadDocumentation(bool $read_documentation)
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
__construct(object $a_parent_obj, string $a_parent_cmd='')
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)
TableGUI class for system styles.
static getCurrentDefaultStyle()
Gets default style of the system.
addMultiCommand(string $a_cmd, string $a_text)
setWithActions(bool $with_actions)
setEnableHeader(bool $a_enableheader)
static _getAllUserAssignedStyles()