DB Migration helper class.
More...
|
static | copyStyleClass ($a_orig_class, $a_class, $a_type, $a_tag, $a_hide=0) |
| Create style class GlossaryLink, link, IntLink. More...
|
|
◆ addStyleClass()
ilScormEditorDBMigrationUtil::addStyleClass |
( |
|
$a_class, |
|
|
|
$a_type, |
|
|
|
$a_tag, |
|
|
|
$a_parameters = "" , |
|
|
|
$a_hide = 0 |
|
) |
| |
Add style class.
- Parameters
-
return
Definition at line 72 of file class.ilScormEditorDBMigrationUtil.php.
73 {
75
76 if ($a_parameters == "")
77 {
78 $a_parameters = array();
79 }
80
81 $set =
$ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
82 while ($rec =
$ilDB->fetchAssoc($set))
83 {
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))
89 {
90 $q = "INSERT INTO style_char (style_id, type, characteristic, hide)".
91 " VALUES (".
92 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
94 $ilDB->quote($a_class,
"text").
",".
95 $ilDB->quote($a_hide,
"integer").
")";
96
97 $ilDB->manipulate($q);
98 foreach ($a_parameters as $k => $v)
99 {
100 $spid =
$ilDB->nextId(
"style_parameter");
101 $q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
102 " VALUES (".
103 $ilDB->quote($spid,
"integer").
",".
104 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
106 $ilDB->quote($a_class,
"text").
",".
107 $ilDB->quote($a_tag,
"text").
",".
108 $ilDB->quote($k,
"text").
",".
109 $ilDB->quote($v,
"text").
110 ")";
111
112 $ilDB->manipulate($q);
113 }
114 }
115 }
116 }
References $a_type, and $ilDB.
◆ copyStyleClass()
static ilScormEditorDBMigrationUtil::copyStyleClass |
( |
|
$a_orig_class, |
|
|
|
$a_class, |
|
|
|
$a_type, |
|
|
|
$a_tag, |
|
|
|
$a_hide = 0 |
|
) |
| |
|
static |
Create style class GlossaryLink, link, IntLink.
- Parameters
-
return
Definition at line 20 of file class.ilScormEditorDBMigrationUtil.php.
21 {
23
24 $set =
$ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
25 while ($rec =
$ilDB->fetchAssoc($set))
26 {
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))
32 {
33 $q = "INSERT INTO style_char (style_id, type, characteristic, hide)".
34 " VALUES (".
35 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
37 $ilDB->quote($a_class,
"text").
",".
38 $ilDB->quote($a_hide,
"integer").
")";
39 $ilDB->manipulate($q);
40
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")
46 );
47 while ($rec3 =
$ilDB->fetchAssoc($set3))
48 {
49 $spid =
$ilDB->nextId(
"style_parameter");
50 $q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
51 " VALUES (".
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").
59 ")";
60 $ilDB->manipulate($q);
61 }
62 }
63 }
64 }
References $a_type, and $ilDB.
The documentation for this class was generated from the following file: