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");
50 $this->ctrl = $DIC->ctrl();
51 $this->lng = $DIC->language();
53 parent::__construct($a_parent_obj, $a_parent_cmd);
58 $this->
addColumn($this->lng->txt(
"style_name"),
"style_name");
59 $this->
addColumn($this->lng->txt(
"skin_name"),
"style_id");
60 $this->
addColumn($this->lng->txt(
"sty_substyle_of"));
61 $this->
addColumn($this->lng->txt(
"default"));
62 $this->
addColumn($this->lng->txt(
"active"));
63 $this->
addColumn($this->lng->txt(
"users"),
"users");
64 $this->
setRowTemplate(
"tpl.sys_styles_row.html",
"Services/Style/System");
77 $this->
setFormAction($this->ctrl->getFormAction($this->getParentObject()));
79 $this->
setRowTemplate(
"tpl.sys_styles_row_with_actions.html",
"Services/Style/System");
82 $this->
addColumn($this->lng->txt(
"actions"));
97 $users_missing_styles = 0;
98 foreach($all_user_styles as $skin_style_id)
100 $style_arr = explode(
":", $skin_style_id);
107 $all_styles = ilStyleDefinition::getAllSkinStyles();
108 if ($users_missing_styles > 0)
110 $all_styles[
"other"] =
112 "title" => $this->lng->txt(
"other"),
115 "skin_id" =>
"other",
117 "skin_name" =>
"other",
119 "users" => $users_missing_styles
134 $this->tpl->setVariable(
"STYLE_NAME", $a_set[
"style_name"]);
135 $this->tpl->setVariable(
"SKIN_NAME", $a_set[
"skin_name"]);
136 $is_substyle = $a_set[
"substyle_of"] !=
"";
139 $this->tpl->setVariable(
"USERS", $a_set[
"users"]);
141 $this->tpl->setVariable(
"USERS",
"-");
144 if($a_set[
"id"] !=
"other"){
145 $this->tpl->setCurrentBlock(
"default_input");
148 $this->tpl->setVariable(
"DEFAULT_ID", $a_set[
"id"]);
152 $this->tpl->setVariable(
"CHECKED_DEFAULT",
' checked="checked" ');
154 $this->tpl->setVariable(
"CHECKED_DEFAULT",
'');
156 $this->tpl->parseCurrentBlock();
159 $this->tpl->setCurrentBlock(
"active_input");
160 $this->tpl->setVariable(
"ACTIVE_ID", $a_set[
"id"]);
163 $this->tpl->setVariable(
"DISABLED_ACTIVE",
'disabled');
166 $this->tpl->setVariable(
"CHECKED_ACTIVE",
' checked="checked" ');
168 $this->tpl->setVariable(
"CHECKED_ACTIVE",
'');
172 $this->tpl->setVariable(
"CHECKED_ACTIVE",
' checked="checked" ');
174 $this->tpl->setVariable(
"CHECKED_ACTIVE",
'');
178 $this->tpl->parseCurrentBlock();
183 $this->tpl->setCurrentBlock(
"substyle");
184 $this->tpl->setVariable(
"SUB_STYLE_OF", $a_set[
"substyle_of_name"]);
188 $a_set[
"substyle_of"],
194 foreach($assignments as $assignment) {
198 $listing = $DIC->ui()->factory()->listing()->unordered($categories);
199 $this->tpl->setVariable(
"CATEGORIES",$DIC->ui()->renderer()->render($listing) );
200 $this->tpl->parseCurrentBlock();
204 if($a_set[
"skin_id"]!=
"default" && $a_set[
"skin_id"]!=
"other"){
205 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'skin_id',$a_set[
"skin_id"]);
206 $this->ctrl->setParameterByClass(
'ilSystemStyleSettingsGUI',
'style_id',$a_set[
"style_id"]);
208 $this->ctrl->setParameterByClass(
'ilSystemStyleOverviewGUI',
'skin_id',$a_set[
"skin_id"]);
209 $this->ctrl->setParameterByClass(
'ilSystemStyleOverviewGUI',
'style_id',$a_set[
"style_id"]);
212 $selection_list->setId(
"id_action_list_" . $a_set[
"id"]);
213 $selection_list->setListTitle($this->lng->txt(
"actions"));
216 $this->tpl->setCurrentBlock(
"multi_actions");
217 $this->tpl->setVariable(
"MULTI_ACTIONS_ID", $a_set[
"id"]);
218 $this->tpl->parseCurrentBlock();
220 $selection_list->addItem($this->lng->txt(
'edit'),
'edit',$this->ctrl->getLinkTargetByClass(
'ilSystemStyleSettingsGUI'));
221 $selection_list->addItem($this->lng->txt(
'delete'),
'delete',$this->ctrl->getLinkTargetByClass(
'ilSystemStyleOverviewGUI',
'deleteStyle'));
224 $selection_list->addItem($this->lng->txt(
'export'),
'export',$this->ctrl->getLinkTargetByClass(
'ilSystemStyleOverviewGUI',
'export'));
227 $this->tpl->setCurrentBlock(
"actions");
228 $this->tpl->setVariable(
"ACTIONS", $selection_list->getHTML());
229 $this->tpl->parseCurrentBlock();
233 $this->tpl->setCurrentBlock(
"actions");
234 $this->tpl->setVariable(
"ACTIONS",
"");
235 $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.
static getSubStyleCategoryAssignments($a_skin_id, $a_style_id, $a_sub_style_id)
Get all system category assignments of exactly one substyle.
setManagementEnabled($management_enabled)
static _lookupTitle($a_id)
lookup object title
addActions($management_enabled)
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
setWithActions($with_actions)
__construct($a_parent_obj, $a_parent_cmd)
ilSystemStylesTableGUI constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setEnableHeader($a_enableheader)
Set Enable Header.
TableGUI class for system styles.
static getCurrentDefaultStyle()
Gets default style of the system.
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.
static _getAllUserAssignedStyles()
skins and styles
setLimit($a_limit=0, $a_default_limit=0)