ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilDBUpdate3136.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
19 static function copyStyleClass($a_orig_class, $a_class, $a_type, $a_tag, $a_hide = 0)
20 {
21 global $ilDB;
22
23 $set = $ilDB->query("SELECT * FROM object_data WHERE type = 'sty'");
24 while ($rec = $ilDB->fetchAssoc($set)) // all styles
25 {
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))
31 {
32 $q = "INSERT INTO style_char (style_id, type, characteristic, hide)".
33 " VALUES (".
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);
39
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")
45 );
46 while ($rec3 = $ilDB->fetchAssoc($set3)) // copy parameters
47 {
48 $spid = $ilDB->nextId("style_parameter");
49 $q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
50 " VALUES (".
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").
58 ")";
59 $ilDB->manipulate($q);
60 }
61 }
62 }
63 }
64
71 function addStyleClass($a_class, $a_type, $a_tag, $a_parameters = "", $a_hide = 0)
72 {
73 global $ilDB;
74
75 if ($a_parameters == "")
76 {
77 $a_parameters = array();
78 }
79
80 $set = $ilDB->query("SELECT * FROM object_data WHERE type = 'sty'");
81 while ($rec = $ilDB->fetchAssoc($set)) // all styles
82 {
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))
88 {
89 $q = "INSERT INTO style_char (style_id, type, characteristic, hide)".
90 " VALUES (".
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").")";
95
96 $ilDB->manipulate($q);
97 foreach ($a_parameters as $k => $v)
98 {
99 $spid = $ilDB->nextId("style_parameter");
100 $q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
101 " VALUES (".
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").
109 ")";
110
111 $ilDB->manipulate($q);
112 }
113 }
114 }
115 }
116
117}
118?>
Update class for step 3136.
addStyleClass($a_class, $a_type, $a_tag, $a_parameters="", $a_hide=0)
Add style class.
static copyStyleClass($a_orig_class, $a_class, $a_type, $a_tag, $a_hide=0)
Create style class GlossaryLink, link, IntLink.
global $ilDB