ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilScormEditorDBMigrationUtil Class Reference

DB Migration helper class. More...

+ Collaboration diagram for ilScormEditorDBMigrationUtil:

Public Member Functions

 addStyleClass ($a_class, $a_type, $a_tag, $a_parameters="", $a_hide=0)
 Add style class. More...
 

Static Public Member Functions

static copyStyleClass ($a_orig_class, $a_class, $a_type, $a_tag, $a_hide=0)
 Create style class GlossaryLink, link, IntLink. More...
 

Detailed Description

DB Migration helper class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ /

Definition at line 11 of file class.ilScormEditorDBMigrationUtil.php.

Member Function Documentation

◆ addStyleClass()

ilScormEditorDBMigrationUtil::addStyleClass (   $a_class,
  $a_type,
  $a_tag,
  $a_parameters = "",
  $a_hide = 0 
)

Add style class.

Parameters

Definition at line 72 of file class.ilScormEditorDBMigrationUtil.php.

References $a_type, $ilDB, and array.

73  {
74  global $ilDB;
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)) // all styles
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").",".
93  $ilDB->quote($a_type, "text").",".
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").",".
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").
110  ")";
111 
112  $ilDB->manipulate($q);
113  }
114  }
115  }
116  }
$a_type
Definition: workflow.php:93
Create styles array
The data for the language used.
global $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

Definition at line 20 of file class.ilScormEditorDBMigrationUtil.php.

References $a_type, and $ilDB.

21  {
22  global $ilDB;
23 
24  $set = $ilDB->query("SELECT * FROM object_data WHERE type = 'sty'");
25  while ($rec = $ilDB->fetchAssoc($set)) // all styles
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").",".
36  $ilDB->quote($a_type, "text").",".
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)) // copy parameters
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  }
$a_type
Definition: workflow.php:93
global $ilDB

The documentation for this class was generated from the following file: