32 $q =
"SELECT count(*) cnt FROM settings_deactivated_s" .
33 " WHERE skin = " .
$DIC->database()->quote($a_skin,
"text") .
34 " AND style = " .
$DIC->database()->quote($a_style,
"text") .
" ";
36 $cnt_set =
$DIC->database()->query($q);
37 $cnt_rec =
$DIC->database()->fetchAssoc($cnt_set);
39 if ($cnt_rec[
"cnt"] > 0) {
57 $q =
"INSERT into settings_deactivated_s" .
58 " (skin, style) VALUES " .
59 " (" .
$DIC->database()->quote($a_skin,
"text") .
"," .
60 " " .
$DIC->database()->quote($a_style,
"text") .
")";
62 $DIC->database()->manipulate($q);
75 $q =
"DELETE FROM settings_deactivated_s" .
76 " WHERE skin = " .
$DIC->database()->quote($a_skin,
"text") .
77 " AND style = " .
$DIC->database()->quote($a_style,
"text");
79 $DIC->database()->manipulate($q);
95 $set =
$DIC->database()->query(
96 "SELECT substyle, category_ref_id FROM syst_style_cat " .
97 " WHERE skin_id = " .
$DIC->database()->quote($a_skin_id,
"text") .
98 " AND style_id = " .
$DIC->database()->quote($a_style_id,
"text")
100 while (($rec =
$DIC->database()->fetchAssoc($set))) {
102 "substyle" => $rec[
"substyle"],
103 "ref_id" => $rec[
"category_ref_id"]
124 $set =
$DIC->database()->query(
125 "SELECT substyle, category_ref_id FROM syst_style_cat " .
126 " WHERE skin_id = " .
$DIC->database()->quote($a_skin_id,
"text") .
127 " AND substyle = " .
$DIC->database()->quote($a_sub_style_id,
"text") .
128 " AND style_id = " .
$DIC->database()->quote($a_style_id,
"text")
130 while (($rec =
$DIC->database()->fetchAssoc($set))) {
132 "substyle" => $rec[
"substyle"],
133 "ref_id" => $rec[
"category_ref_id"]
158 foreach ($assignments as $assignment) {
159 if ($assignment[
"ref_id"] == $a_ref_id) {
163 $DIC->database()->manipulate(
"INSERT INTO syst_style_cat " .
164 "(skin_id, style_id, substyle, category_ref_id) VALUES (" .
165 $DIC->database()->quote($a_skin_id,
"text") .
"," .
166 $DIC->database()->quote($a_style_id,
"text") .
"," .
167 $DIC->database()->quote($a_substyle,
"text") .
"," .
168 $DIC->database()->quote($a_ref_id,
"integer") .
189 $DIC->database()->manipulate(
"DELETE FROM syst_style_cat WHERE " .
190 " skin_id = " .
$DIC->database()->quote($a_skin_id,
"text") .
191 " AND style_id = " .
$DIC->database()->quote($a_style_id,
"text") .
192 " AND substyle = " .
$DIC->database()->quote($a_substyle,
"text") .
193 " AND category_ref_id = " .
$DIC->database()->quote($a_ref_id,
"integer"));
207 $DIC->database()->manipulate(
"DELETE FROM syst_style_cat WHERE " .
208 " skin_id = " .
$DIC->database()->quote($a_skin_id,
"text") .
209 " AND style_id = " .
$DIC->database()->quote($a_style_id,
"text") .
210 " AND substyle = " .
$DIC->database()->quote($a_substyle,
"text"));
223 $DIC->user()->setPref(
"skin", $skin_id);
224 $DIC->user()->setPref(
"style", $style_id);
225 $DIC->user()->update();
237 return $DIC->user()->getPref(
"skin");
249 return $DIC->user()->getPref(
"style");
262 $DIC->clientIni()->setVariable(
"layout",
"skin", $skin_id);
263 $DIC->clientIni()->setVariable(
"layout",
"style", $style_id);
264 $DIC->clientIni()->write();
284 $skin_id =
$DIC->clientIni()->readVariable(
"layout",
"skin");
288 $skin_id =
$DIC->clientIni()->readVariable(
"layout",
"skin");
302 $skin_id =
$DIC->clientIni()->readVariable(
"layout",
"skin");
303 $style_id =
$DIC->clientIni()->readVariable(
"layout",
"style");
307 $style_id =
$DIC->clientIni()->readVariable(
"layout",
"style");
An exception for terminatinating execution or to throw for unit testing.
static skinExists($skin_id, ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
static styleExistsForSkinId($skin_id, $style_id)
ilSystemStyleConfig wraps all 'constants' to ensure the testability of all classes using those 'const...
Class for advanced editing exception handling in ILIAS.
const SUBSTYLE_ASSIGNMENT_EXISTS
This class acts as Model for all system styles settings related settings such as activated or default...
static getSubStyleCategoryAssignments($a_skin_id, $a_style_id, $a_sub_style_id)
Get all system category assignments of exactly one substyle.
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.
static getCurrentUserPrefSkin()
Gets a users preferred skin by using the user object.
static setCurrentDefaultStyle($skin_id, $style_id)
Sets the default style of the system.
static _activateStyle($a_skin, $a_style)
activate system style
static resetDefaultToDelos()
static _deactivateStyle($a_skin, $a_style)
deactivate system style
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
static getCurrentDefaultSkin()
Gets default Skin of the System.
static setCurrentUserPrefStyle($skin_id, $style_id)
Sets a users preferred system skin/style by using the user object.
static getSystemStyleCategoryAssignments($a_skin_id, $a_style_id)
Get all system sub styles category assignments.
static deleteSubStyleCategoryAssignments($a_skin_id, $a_style_id, $a_substyle)
Delets a sub styles category assignment.
static getCurrentUserPrefStyle()
Gets a users preferred style by using the user object.
static deleteSystemStyleCategoryAssignment( $a_skin_id, $a_style_id, $a_substyle, $a_ref_id)
Deletes all sub style category assignment of a system style.