2 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
3 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
6 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
54 $this->ctrl = $DIC->ctrl();
55 $this->lng = $DIC->language();
57 parent::__construct($a_parent_obj, $a_parent_cmd);
61 $this->
setTitle($this->lng->txt(
"manage_system_styles"));
63 $this->
addColumn($this->lng->txt(
"style_name"),
"style_name");
64 $this->
addColumn($this->lng->txt(
"skin_name"),
"skin_name");
65 $this->
addColumn($this->lng->txt(
"sty_substyle_of"));
66 $this->
addColumn($this->lng->txt(
"scope"));
67 $this->
addColumn($this->lng->txt(
"default"));
68 $this->
addColumn($this->lng->txt(
"active"));
69 $this->
addColumn($this->lng->txt(
"users"),
"users");
70 $this->
setRowTemplate(
"tpl.sys_styles_row.html",
"Services/Style/System");
83 $this->
setFormAction($this->ctrl->getFormAction($this->getParentObject()));
85 $this->
setRowTemplate(
"tpl.sys_styles_row_with_actions.html",
"Services/Style/System");
90 $this->
addColumn($this->lng->txt(
"actions"));
107 $users_missing_styles = 0;
108 foreach ($all_user_styles as $skin_style_id) {
109 $style_arr = explode(
":", $skin_style_id);
115 if ($users_missing_styles > 0) {
116 $all_styles[
"other"] =
118 "title" => $this->lng->txt(
"other"),
121 "skin_id" =>
"other",
123 "skin_name" =>
"other",
125 "users" => $users_missing_styles
140 $this->tpl->setVariable(
"STYLE_NAME", $a_set[
"style_name"]);
141 $this->tpl->setVariable(
"SKIN_NAME", $a_set[
"skin_name"]);
142 $is_substyle = $a_set[
"substyle_of"] !=
"";
145 $this->tpl->setVariable(
"USERS", $a_set[
"users"]);
147 $this->tpl->setVariable(
"USERS",
"-");
150 if ($a_set[
"id"] !=
"other") {
151 $this->tpl->setCurrentBlock(
"default_input");
154 $this->tpl->setVariable(
"DEFAULT_ID", $a_set[
"id"]);
158 $this->tpl->setVariable(
"CHECKED_DEFAULT",
' checked="checked" ');
160 $this->tpl->setVariable(
"CHECKED_DEFAULT",
'');
162 $this->tpl->parseCurrentBlock();
165 $this->tpl->setCurrentBlock(
"active_input");
166 $this->tpl->setVariable(
"ACTIVE_ID", $a_set[
"id"]);
169 $this->tpl->setVariable(
"DISABLED_ACTIVE",
'disabled');
172 $this->tpl->setVariable(
"CHECKED_ACTIVE",
' checked="checked" ');
174 $this->tpl->setVariable(
"CHECKED_ACTIVE",
'');
178 $this->tpl->setVariable(
"CHECKED_ACTIVE",
' checked="checked" ');
180 $this->tpl->setVariable(
"CHECKED_ACTIVE",
'');
184 $this->tpl->parseCurrentBlock();
188 $this->tpl->setVariable(
"SUB_STYLE_OF", $a_set[
"substyle_of_name"]);
192 $a_set[
"substyle_of"],
198 foreach ($assignments as $assignment) {
200 if ($category_title) {
201 $categories[] = $category_title;
205 $listing = $DIC->ui()->factory()->listing()->unordered($categories);
206 $this->tpl->setVariable(
208 $this->lng->txt(
"local") . $DIC->ui()->renderer()->render($listing)
211 $this->tpl->setVariable(
"SUB_STYLE_OF",
"");
212 $this->tpl->setVariable(
"CATEGORIES", $this->lng->txt(
"global"));
216 if ($a_set[
"skin_id"] ==
"other") {
217 $this->tpl->setCurrentBlock(
"actions");
218 $this->tpl->setVariable(
"ACTIONS",
"");
219 $this->tpl->parseCurrentBlock();
222 $action_list->setId(
"id_action_list_" . $a_set[
"id"]);
223 $action_list->setListTitle($this->lng->txt(
"actions"));
226 $DIC->ctrl()->setParameterByClass(
'ilSystemStyleDocumentationGUI',
'skin_id', $a_set[
"skin_id"]);
227 $DIC->ctrl()->setParameterByClass(
'ilSystemStyleDocumentationGUI',
'style_id', $a_set[
"style_id"]);
228 $action_list->addItem(
229 $this->lng->txt(
'open_documentation'),
231 $this->ctrl->getLinkTargetByClass(
'ilSystemStyleDocumentationGUI',
'entries')
236 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'skin_id', $a_set[
"skin_id"]);
237 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'style_id', $a_set[
"style_id"]);
239 $this->ctrl->setParameterByClass(
'ilSystemStyleOverviewGUI',
'skin_id', $a_set[
"skin_id"]);
240 $this->ctrl->setParameterByClass(
'ilSystemStyleOverviewGUI',
'style_id', $a_set[
"style_id"]);
243 if ($a_set[
"skin_id"] !=
$config->getDefaultSkinId()) {
247 if (!$is_substyle && $a_set[
"skin_id"] !=
"default") {
248 $action_list->addItem($this->lng->txt(
'export'),
'export', $this->ctrl->getLinkTargetByClass(
'ilSystemStyleOverviewGUI',
'export'));
253 $this->tpl->setCurrentBlock(
"actions");
254 $this->tpl->setVariable(
"ACTIONS", $action_list->getHTML());
255 $this->tpl->parseCurrentBlock();
262 $action_list->
addItem($this->lng->txt(
'edit'),
'edit', $this->ctrl->getLinkTargetByClass(
'ilSystemStyleSettingsGUI'));
263 $action_list->
addItem($this->lng->txt(
'delete'),
'delete', $this->ctrl->getLinkTargetByClass(
'ilSystemStyleOverviewGUI',
'deleteStyle'));
268 $this->tpl->setCurrentBlock(
"multi_actions");
269 $this->tpl->setVariable(
"MULTI_ACTIONS_ID",
$id);
270 $this->tpl->parseCurrentBlock();
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static _getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles
static styleExists($style_id)
static getCurrentDefaultSkin()
Gets default Skin of the System.
addManagementActionsToList(ilAdvancedSelectionListGUI $action_list)
static getSubStyleCategoryAssignments($a_skin_id, $a_style_id, $a_sub_style_id)
Get all system category assignments of exactly one substyle.
if(!array_key_exists('StateId', $_REQUEST)) $id
setManagementEnabled($management_enabled)
static _lookupTitle($a_id)
lookup object title
setReadDocumentation($read_documentation)
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static getAllSkinStyles()
Get all skins/styles as array (convenient for tables) Attention: tempalte_name/template_id in this ar...
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
addItem( $a_title, $a_value="", $a_link="", $a_img="", $a_alt="", $a_frame="", $a_html="", $a_prevent_background_click=false, $a_onclick="", $a_ttip="", $a_tt_my="right center", $a_tt_at="left center", $a_tt_use_htmlspecialchars=true, $a_data=array())
Add an item.
setWithActions($with_actions)
__construct($a_parent_obj, $a_parent_cmd)
ilSystemStylesTableGUI constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
User interface class for advanced drop-down selection lists.
addActions($management_enabled, $read_documentation=true)
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setEnableHeader($a_enableheader)
Set Enable Header.
TableGUI class for system styles.
static getCurrentDefaultStyle()
Gets default style of the system.
static _getAllUserAssignedStyles()
skins and styles
setLimit($a_limit=0, $a_default_limit=0)