24 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
40 $set = $ilDB->query(
"SELECT DISTINCT style_id, tag, class FROM style_parameter
41 WHERE ".$ilDB->equals(
"type",
"",
"text",
true));
42 while ($rec = $ilDB->fetchAssoc($set))
50 if (in_array($rec[
"class"], array(
"Headline3",
"Headline1",
51 "Headline2",
"TableContent",
"List",
"Standard",
"Remark",
52 "Additional",
"Mnemonic",
"Citation",
"Example")))
54 $types[] =
"text_block";
56 if (in_array($rec[
"class"], array(
"Block",
"Remark",
57 "Additional",
"Mnemonic",
"Example",
"Excursus",
"Special")))
61 if (in_array($rec[
"class"], array(
"Page",
"Footnote",
"PageTitle",
"LMNavigation")))
68 $types[] =
"table_cell";
72 if (in_array($rec[
"class"], array(
"ExtLink",
"IntLink",
"FootnoteLink")))
79 $types[] =
"text_inline";
88 foreach ($types as
$t)
91 $st = $ilDB->prepare(
"SELECT * FROM style_char ".
92 " WHERE style_id = ? AND type = ? AND characteristic = ?",
93 array(
"integer",
"text",
"text"));
94 $set4 = $ilDB->execute($st,
95 array($rec[
"style_id"], $t, $rec[
"class"]));
96 if ($rec4 = $ilDB->fetchAssoc($set4))
103 $st = $ilDB->prepareManip(
"INSERT INTO style_char ".
104 " (style_id, type, characteristic) VALUES ".
106 array(
"integer",
"text",
"text"));
108 array($rec[
"style_id"], $t, $rec[
"class"]));
113 if ($rec[
"type"] ==
"")
115 if (count($types) > 0)
117 $ilDB->manipulateF(
"UPDATE style_parameter SET type = %s ".
118 " WHERE style_id = %s AND class = %s AND type = %s",
119 array(
"text",
"integer",
"text",
"text"),
120 array($types[0], $rec[
"style_id"], $rec[
"class"],
""));
124 if ($types[0] ==
"link")
126 $ilDB->manipulateF(
"UPDATE style_parameter SET type = %s ".
127 " WHERE style_id = %s AND (class = %s OR class = %s) AND type = %s",
128 array(
"text",
"integer",
"text",
"text",
"text"),
129 array($types[0], $rec[
"style_id"], $rec[
"class"].
":visited",
130 $rec[
"class"].
":hover",
""));
134 if (count($types) == 2)
139 $set2 = $ilDB->queryF(
"SELECT * FROM style_parameter ".
140 " WHERE style_id = %s AND class = %s AND type = %s",
141 array(
"integer",
"text",
"text"),
142 array($rec[
"style_id"], $rec[
"class"], $types[0]));
143 while ($rec2 = $ilDB->fetchAssoc($set2))
147 $set3 = $ilDB->queryF(
"SELECT * FROM style_parameter ".
148 " WHERE style_id = %s AND tag = %s AND class = %s AND type = %s AND parameter = %s",
149 array(
"integer",
"text",
"text",
"text",
"text",
"text"),
150 array($rec[
"style_id"], $rec[
"tag"], $rec[
"class"], $types[1], $rec[
"parameter"]));
151 if ($rec3 = $ilDB->fetchAssoc($set3))
158 $id = $ilDB->nextId(
"style_parameter");
159 $st = $ilDB->prepareManip(
"INSERT INTO style_parameter ".
160 " (id,style_id, tag, class, parameter, value, type) VALUES ".
161 " (%s,%s,%s,%s,%s,%s,%s) ",
162 array(
"integer",
"integer",
"text",
"text",
"text",
"text",
"text"),
163 array($id, $rec2[
"style_id"], $rec2[
"tag"], $rec2[
"class"],
164 $rec2[
"parameter"], $rec2[
"value"], $types[1]));