20 static function copyStyleClass($a_orig_class, $a_class, $a_type, $a_tag, $a_hide = 0)
24 $set = $ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
25 while ($rec = $ilDB->fetchAssoc($set))
27 $set2 = $ilDB->query(
"SELECT * FROM style_char WHERE ".
28 "style_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
" AND ".
29 "characteristic = ".$ilDB->quote($a_class,
"text").
" AND ".
30 "type = ".$ilDB->quote($a_type,
"text"));
31 if (!$ilDB->fetchAssoc($set2))
33 $q =
"INSERT INTO style_char (style_id, type, characteristic, hide)".
35 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
36 $ilDB->quote($a_type,
"text").
",".
37 $ilDB->quote($a_class,
"text").
",".
38 $ilDB->quote($a_hide,
"integer").
")";
39 $ilDB->manipulate($q);
41 $set3 = $ilDB->query(
"SELECT * FROM style_parameter WHERE ".
42 "style_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
" AND ".
43 "type = ".$ilDB->quote($a_type,
"text").
" AND ".
44 "class = ".$ilDB->quote($a_orig_class,
"text").
" AND ".
45 "tag = ".$ilDB->quote($a_tag,
"text")
47 while ($rec3 = $ilDB->fetchAssoc($set3))
49 $spid = $ilDB->nextId(
"style_parameter");
50 $q =
"INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
52 $ilDB->quote($spid,
"integer").
",".
53 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
54 $ilDB->quote($rec3[
"type"],
"text").
",".
55 $ilDB->quote($a_class,
"text").
",".
56 $ilDB->quote($a_tag,
"text").
",".
57 $ilDB->quote($rec3[
"parameter"],
"text").
",".
58 $ilDB->quote($rec3[
"value"],
"text").
60 $ilDB->manipulate($q);
72 function addStyleClass($a_class, $a_type, $a_tag, $a_parameters =
"", $a_hide = 0)
76 if ($a_parameters ==
"")
78 $a_parameters = array();
81 $set = $ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
82 while ($rec = $ilDB->fetchAssoc($set))
84 $set2 = $ilDB->query(
"SELECT * FROM style_char WHERE ".
85 "style_id = ".$ilDB->quote($rec[
"obj_id"],
"integer").
" AND ".
86 "characteristic = ".$ilDB->quote($a_class,
"text").
" AND ".
87 "type = ".$ilDB->quote($a_type,
"text"));
88 if (!$ilDB->fetchAssoc($set2))
90 $q =
"INSERT INTO style_char (style_id, type, characteristic, hide)".
92 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
93 $ilDB->quote($a_type,
"text").
",".
94 $ilDB->quote($a_class,
"text").
",".
95 $ilDB->quote($a_hide,
"integer").
")";
97 $ilDB->manipulate($q);
98 foreach ($a_parameters as $k => $v)
100 $spid = $ilDB->nextId(
"style_parameter");
101 $q =
"INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
103 $ilDB->quote($spid,
"integer").
",".
104 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
105 $ilDB->quote($a_type,
"text").
",".
106 $ilDB->quote($a_class,
"text").
",".
107 $ilDB->quote($a_tag,
"text").
",".
108 $ilDB->quote($k,
"text").
",".
109 $ilDB->quote($v,
"text").
112 $ilDB->manipulate($q);