ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDBUpdate3136 Class Reference

Update class for step 3136. More...

+ Collaboration diagram for ilDBUpdate3136:

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

Update class for step 3136.

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.ilDBUpdate3136.php.

Member Function Documentation

◆ addStyleClass()

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

Add style class.

Parameters

Definition at line 69 of file class.ilDBUpdate3136.php.

References $a_type, $ilDB, and array.

70  {
71  global $ilDB;
72 
73  if ($a_parameters == "") {
74  $a_parameters = array();
75  }
76 
77  $set = $ilDB->query("SELECT * FROM object_data WHERE type = 'sty'");
78  while ($rec = $ilDB->fetchAssoc($set)) { // all styles
79  $set2 = $ilDB->query("SELECT * FROM style_char WHERE " .
80  "style_id = " . $ilDB->quote($rec["obj_id"], "integer") . " AND " .
81  "characteristic = " . $ilDB->quote($a_class, "text") . " AND " .
82  "type = " . $ilDB->quote($a_type, "text"));
83  if (!$ilDB->fetchAssoc($set2)) {
84  $q = "INSERT INTO style_char (style_id, type, characteristic, hide)" .
85  " VALUES (" .
86  $ilDB->quote($rec["obj_id"], "integer") . "," .
87  $ilDB->quote($a_type, "text") . "," .
88  $ilDB->quote($a_class, "text") . "," .
89  $ilDB->quote($a_hide, "integer") . ")";
90 
91  $ilDB->manipulate($q);
92  foreach ($a_parameters as $k => $v) {
93  $spid = $ilDB->nextId("style_parameter");
94  $q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)" .
95  " VALUES (" .
96  $ilDB->quote($spid, "integer") . "," .
97  $ilDB->quote($rec["obj_id"], "integer") . "," .
98  $ilDB->quote($a_type, "text") . "," .
99  $ilDB->quote($a_class, "text") . "," .
100  $ilDB->quote($a_tag, "text") . "," .
101  $ilDB->quote($k, "text") . "," .
102  $ilDB->quote($v, "text") .
103  ")";
104 
105  $ilDB->manipulate($q);
106  }
107  }
108  }
109  }
$a_type
Definition: workflow.php:92
Create styles array
The data for the language used.
global $ilDB

◆ copyStyleClass()

static ilDBUpdate3136::copyStyleClass (   $a_orig_class,
  $a_class,
  $a_type,
  $a_tag,
  $a_hide = 0 
)
static

Create style class GlossaryLink, link, IntLink.

Parameters

Definition at line 19 of file class.ilDBUpdate3136.php.

References $a_type, and $ilDB.

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  $set2 = $ilDB->query("SELECT * FROM style_char WHERE " .
26  "style_id = " . $ilDB->quote($rec["obj_id"], "integer") . " AND " .
27  "characteristic = " . $ilDB->quote($a_class, "text") . " AND " .
28  "type = " . $ilDB->quote($a_type, "text"));
29  if (!$ilDB->fetchAssoc($set2)) {
30  $q = "INSERT INTO style_char (style_id, type, characteristic, hide)" .
31  " VALUES (" .
32  $ilDB->quote($rec["obj_id"], "integer") . "," .
33  $ilDB->quote($a_type, "text") . "," .
34  $ilDB->quote($a_class, "text") . "," .
35  $ilDB->quote($a_hide, "integer") . ")";
36  $ilDB->manipulate($q);
37 
38  $set3 = $ilDB->query(
39  "SELECT * FROM style_parameter WHERE " .
40  "style_id = " . $ilDB->quote($rec["obj_id"], "integer") . " AND " .
41  "type = " . $ilDB->quote($a_type, "text") . " AND " .
42  "class = " . $ilDB->quote($a_orig_class, "text") . " AND " .
43  "tag = " . $ilDB->quote($a_tag, "text")
44  );
45  while ($rec3 = $ilDB->fetchAssoc($set3)) { // copy parameters
46  $spid = $ilDB->nextId("style_parameter");
47  $q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)" .
48  " VALUES (" .
49  $ilDB->quote($spid, "integer") . "," .
50  $ilDB->quote($rec["obj_id"], "integer") . "," .
51  $ilDB->quote($rec3["type"], "text") . "," .
52  $ilDB->quote($a_class, "text") . "," .
53  $ilDB->quote($a_tag, "text") . "," .
54  $ilDB->quote($rec3["parameter"], "text") . "," .
55  $ilDB->quote($rec3["value"], "text") .
56  ")";
57  $ilDB->manipulate($q);
58  }
59  }
60  }
61  }
$a_type
Definition: workflow.php:92
global $ilDB

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