32 $q =
"SELECT count(*) cnt FROM settings_deactivated_s".
33 " WHERE skin = ".$ilDB->quote($a_skin,
"text").
34 " AND style = ".$ilDB->quote($a_style,
"text").
" ";
36 $cnt_set = $ilDB->query($q);
37 $cnt_rec = $ilDB->fetchAssoc($cnt_set);
39 if ($cnt_rec[
"cnt"] > 0)
60 $q =
"INSERT into settings_deactivated_s".
61 " (skin, style) VALUES ".
62 " (".$ilDB->quote($a_skin,
"text").
",".
63 " ".$ilDB->quote($a_style,
"text").
")";
65 $ilDB->manipulate($q);
78 $q =
"DELETE FROM settings_deactivated_s".
79 " WHERE skin = ".$ilDB->quote($a_skin,
"text").
80 " AND style = ".$ilDB->quote($a_style,
"text");
82 $ilDB->manipulate($q);
98 $set = $ilDB->query(
"SELECT substyle, category_ref_id FROM syst_style_cat ".
99 " WHERE skin_id = ".$ilDB->quote($a_skin_id,
"text").
100 " AND style_id = ".$ilDB->quote($a_style_id,
"text")
102 while (($rec = $ilDB->fetchAssoc($set)))
105 "substyle" => $rec[
"substyle"],
106 "ref_id" => $rec[
"category_ref_id"]
127 $set = $ilDB->query(
"SELECT substyle, category_ref_id FROM syst_style_cat ".
128 " WHERE skin_id = ".$ilDB->quote($a_skin_id,
"text").
129 " AND substyle = ".$ilDB->quote($a_sub_style_id,
"text").
130 " AND style_id = ".$ilDB->quote($a_style_id,
"text")
132 while (($rec = $ilDB->fetchAssoc($set)))
135 "substyle" => $rec[
"substyle"],
136 "ref_id" => $rec[
"category_ref_id"]
152 $a_substyle, $a_ref_id)
156 $assignments = self::getSubStyleCategoryAssignments($a_skin_id, $a_style_id,$a_substyle);
158 foreach($assignments as $assignment){
159 if($assignment[
"ref_id"] == $a_ref_id){
163 $ilDB->manipulate(
"INSERT INTO syst_style_cat ".
164 "(skin_id, style_id, substyle, category_ref_id) VALUES (".
165 $ilDB->quote($a_skin_id,
"text").
",".
166 $ilDB->quote($a_style_id,
"text").
",".
167 $ilDB->quote($a_substyle,
"text").
",".
168 $ilDB->quote($a_ref_id,
"integer").
182 $a_substyle, $a_ref_id)
186 $ilDB->manipulate(
"DELETE FROM syst_style_cat WHERE ".
187 " skin_id = ".$ilDB->quote($a_skin_id,
"text").
188 " AND style_id = ".$ilDB->quote($a_style_id,
"text").
189 " AND substyle = ".$ilDB->quote($a_substyle,
"text").
190 " AND category_ref_id = ".$ilDB->quote($a_ref_id,
"integer"));
204 $ilDB->manipulate(
"DELETE FROM syst_style_cat WHERE ".
205 " skin_id = ".$ilDB->quote($a_skin_id,
"text").
206 " AND style_id = ".$ilDB->quote($a_style_id,
"text").
207 " AND substyle = ".$ilDB->quote($a_substyle,
"text"));
219 $DIC->user()->setPref(
"skin",$skin_id);
220 $DIC->user()->setPref(
"style",$style_id);
221 $DIC->user()->update();
232 return $DIC->user()->getPref(
"skin");
243 return $DIC->user()->getPref(
"style");
255 $DIC[
'ilias']->ini->setVariable(
"layout",
"skin", $skin_id);
256 $DIC[
'ilias']->ini->setVariable(
"layout",
"style",$style_id);
257 $DIC[
'ilias']->ini->write();
258 self::_activateStyle($skin_id, $style_id);
265 self::setCurrentDefaultStyle($system_style_conf->getDefaultSkinId(),$system_style_conf->getDefaultSkinId());
275 $skin_id = $DIC[
'ilias']->ini->readVariable(
"layout",
"skin");
278 self::resetDefaultToDelos();
279 $skin_id = $DIC[
'ilias']->ini->readVariable(
"layout",
"skin");
290 $skin_id = $DIC[
'ilias']->ini->readVariable(
"layout",
"skin");
291 $style_id = $DIC[
'ilias']->ini->readVariable(
"layout",
"style");
294 self::resetDefaultToDelos();
295 $style_id = $DIC[
'ilias']->ini->readVariable(
"layout",
"style");
static _deactivateStyle($a_skin, $a_style)
deactivate system style
const SUBSTYLE_ASSIGNMENT_EXISTS
static getSystemStyleCategoryAssignments($a_skin_id, $a_style_id)
Get all system sub styles category assignments.
static getCurrentUserPrefSkin()
Gets a users preferred skin by using the user object.
static getCurrentDefaultSkin()
Gets default Skin of the System.
static resetDefaultToDelos()
static getSubStyleCategoryAssignments($a_skin_id, $a_style_id, $a_sub_style_id)
Get all system category assignments of exactly one substyle.
static setCurrentDefaultStyle($skin_id, $style_id)
Sets the default style of the system.
static getCurrentUserPrefStyle()
Gets a users preferred style by using the user object.
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
static styleExistsForSkinId($skin_id, $style_id)
static deleteSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Deletes all sub style category assignment of a system style.
static deleteSubStyleCategoryAssignments($a_skin_id, $a_style_id, $a_substyle)
Delets a sub styles category assignment.
Class for advanced editing exception handling in ILIAS.
static skinExists($skin_id, ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
static setCurrentUserPrefStyle($skin_id, $style_id)
Sets a users preferred system skin/style by using the user object.
This class acts as Model for all system styles settings related settings such as activated or default...
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
static _activateStyle($a_skin, $a_style)
activate system style
static writeSystemStyleCategoryAssignment($a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Sets a substyle category assignment.
static getCurrentDefaultStyle()
Gets default style of the system.