41 : void {
44
45 $sql =
46 "SELECT obj_id" . PHP_EOL
47 . "FROM object_data" . PHP_EOL
48 . "WHERE type = 'sty'" . PHP_EOL
49 ;
50 $set = $db->query($sql);
51
52 while ($row = $db->fetchAssoc($set)) {
53 $sql =
54 "SELECT style_id, type, characteristic, hide" . PHP_EOL
55 . "FROM style_char" . PHP_EOL
56 . "WHERE style_id = " . $db->quote($row["obj_id"], "integer") . PHP_EOL
57 . "AND characteristic = " . $db->quote($class, "text") . PHP_EOL
58 . "AND type = " . $db->quote($type, "text") . PHP_EOL
59 ;
60 $res = $db->query($sql);
61
62 if (!$db->fetchAssoc(
$res)) {
63 $values = [
64 "style_id" => ["integer", $row["obj_id"]],
65 "type" => ["text", $type],
66 "characteristic" => ["text", $class],
67 "hide" => ["integer", $hide]
68 ];
69 $db->insert("style_char", $values);
70
71 $sql =
72 "SELECT id, style_id, tag, class, parameter, value, type, mq_id, custom" . PHP_EOL
73 . "FROM style_parameter" . PHP_EOL
74 . "WHERE style_id = " . $db->quote($row["obj_id"], "integer") . PHP_EOL
75 . "AND type = " . $db->quote($type, "text") . PHP_EOL
76 . "AND class = " . $db->quote($orig_class, "text") . PHP_EOL
77 . "AND tag = " . $db->quote($tag, "text") . PHP_EOL
78 ;
79
80 $res = $db->query($sql);
81
82 while ($row_2 = $db->fetchAssoc(
$res)) {
83 $spid = $db->nextId("style_parameter");
84 $values = [
85 "id" => ["integer", $spid],
86 "style_id" => ["integer", $row["obj_id"]],
87 "tag" => ["text", $tag],
88 "class" => ["text", $class],
89 "parameter" => ["text", $row_2["parameter"]],
90 "value" => ["text", $row_2["value"]],
91 "type" => ["text", $row_2["type"]]
92 ];
93 $db->insert("style_parameter", $values);
94 }
95 }
96 }
97 }