19 static function copyStyleClass($a_orig_class, $a_class, $a_type, $a_tag, $a_hide = 0)
23 $set = $ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
24 while ($rec = $ilDB->fetchAssoc($set))
26 $set2 = $ilDB->query(
"SELECT * FROM style_char WHERE ".
27 "style_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
" AND ".
28 "characteristic = ".$ilDB->quote($a_class,
"text").
" AND ".
29 "type = ".$ilDB->quote($a_type,
"text"));
30 if (!$ilDB->fetchAssoc($set2))
32 $q =
"INSERT INTO style_char (style_id, type, characteristic, hide)".
34 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
35 $ilDB->quote($a_type,
"text").
",".
36 $ilDB->quote($a_class,
"text").
",".
37 $ilDB->quote($a_hide,
"integer").
")";
38 $ilDB->manipulate($q);
40 $set3 = $ilDB->query(
"SELECT * FROM style_parameter WHERE ".
41 "style_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
" AND ".
42 "type = ".$ilDB->quote($a_type,
"text").
" AND ".
43 "class = ".$ilDB->quote($a_orig_class,
"text").
" AND ".
44 "tag = ".$ilDB->quote($a_tag,
"text")
46 while ($rec3 = $ilDB->fetchAssoc($set3))
48 $spid = $ilDB->nextId(
"style_parameter");
49 $q =
"INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
51 $ilDB->quote($spid,
"integer").
",".
52 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
53 $ilDB->quote($rec3[
"type"],
"text").
",".
54 $ilDB->quote($a_class,
"text").
",".
55 $ilDB->quote($a_tag,
"text").
",".
56 $ilDB->quote($rec3[
"parameter"],
"text").
",".
57 $ilDB->quote($rec3[
"value"],
"text").
59 $ilDB->manipulate($q);
71 function addStyleClass($a_class, $a_type, $a_tag, $a_parameters =
"", $a_hide = 0)
75 if ($a_parameters ==
"")
77 $a_parameters = array();
80 $set = $ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
81 while ($rec = $ilDB->fetchAssoc($set))
83 $set2 = $ilDB->query(
"SELECT * FROM style_char WHERE ".
84 "style_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
" AND ".
85 "characteristic = ".$ilDB->quote($a_class,
"text").
" AND ".
86 "type = ".$ilDB->quote($a_type,
"text"));
87 if (!$ilDB->fetchAssoc($set2))
89 $q =
"INSERT INTO style_char (style_id, type, characteristic, hide)".
91 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
92 $ilDB->quote($a_type,
"text").
",".
93 $ilDB->quote($a_class,
"text").
",".
94 $ilDB->quote($a_hide,
"integer").
")";
96 $ilDB->manipulate($q);
97 foreach ($a_parameters as $k => $v)
99 $spid = $ilDB->nextId(
"style_parameter");
100 $q =
"INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
102 $ilDB->quote($spid,
"integer").
",".
103 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
104 $ilDB->quote($a_type,
"text").
",".
105 $ilDB->quote($a_class,
"text").
",".
106 $ilDB->quote($a_tag,
"text").
",".
107 $ilDB->quote($k,
"text").
",".
108 $ilDB->quote($v,
"text").
111 $ilDB->manipulate($q);