ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDBUpdate3136 Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilDBUpdate3136:

Static Public Member Functions

static copyStyleClass (string $orig_class, string $class, string $type, string $tag, int $hide=0)
 Create style class GlossaryLink, link, IntLink. More...
 
static addStyleClass (string $class, string $type, string $tag, array $parameters=[], int $hide=0)
 Add style class. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 28 of file class.ilDBUpdate3136.php.

Member Function Documentation

◆ addStyleClass()

static ilDBUpdate3136::addStyleClass ( string  $class,
string  $type,
string  $tag,
array  $parameters = [],
int  $hide = 0 
)
static

Add style class.

Deprecated:
use Services/Style/classes/Setup/class.ilStyleClassAddedObjective.php instead

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

References $ilDB, $res, and $type.

110  : void {
111  global $ilDB;
112  $db = $ilDB;
113 
114  $sql =
115  "SELECT obj_id" . PHP_EOL
116  . "FROM object_data" . PHP_EOL
117  . "WHERE type = 'sty'" . PHP_EOL
118  ;
119  $result = $db->query($sql);
120 
121  while ($row = $db->fetchAssoc($result)) {
122  $sql =
123  "SELECT style_id, type, characteristic, hide" . PHP_EOL
124  . "FROM style_char" . PHP_EOL
125  . "WHERE style_id = " . $db->quote($row["obj_id"], "integer") . PHP_EOL
126  . "AND characteristic = " . $db->quote($class, "text") . PHP_EOL
127  . "AND type = " . $db->quote($type, "text") . PHP_EOL;
128  $res = $db->query($sql);
129 
130  if (!$db->fetchAssoc($res)) {
131  $values = [
132  "style_id" => ["integer", $row["obj_id"]],
133  "type" => ["text", $type],
134  "characteristic" => ["text", $class],
135  "hide" => ["integer", $hide]
136  ];
137  $db->insert("style_char", $values);
138 
139  foreach ($parameters as $k => $v) {
140  $spid = $db->nextId("style_parameter");
141  $values = [
142  "id" => ["integer", $spid],
143  "style_id" => ["integer", $row["obj_id"]],
144  "tag" => ["text", $tag],
145  "class" => ["text", $class],
146  "parameter" => ["text", $k],
147  "value" => ["text", $v],
148  "type" => ["text", $type]
149  ];
150  $db->insert("style_parameter", $values);
151  }
152  }
153  }
154  }
$res
Definition: ltiservices.php:69
$type

◆ copyStyleClass()

static ilDBUpdate3136::copyStyleClass ( string  $orig_class,
string  $class,
string  $type,
string  $tag,
int  $hide = 0 
)
static

Create style class GlossaryLink, link, IntLink.

Deprecated:
use Services/Style/classes/Setup/class.ilStyleClassCopiedObjective.php instead

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

References $ilDB, $res, and $type.

41  : void {
42  global $ilDB;
43  $db = $ilDB;
44 
45  $sql =
46  "SELECT obj_id" . PHP_EOL
47  . "FROM object_data" . PHP_EOL
48  . "WHERE type = 'sty'" . PHP_EOL
49  ;
50  $set = $db->query($sql);
51 
52  while ($row = $db->fetchAssoc($set)) {
53  $sql =
54  "SELECT style_id, type, characteristic, hide" . PHP_EOL
55  . "FROM style_char" . PHP_EOL
56  . "WHERE style_id = " . $db->quote($row["obj_id"], "integer") . PHP_EOL
57  . "AND characteristic = " . $db->quote($class, "text") . PHP_EOL
58  . "AND type = " . $db->quote($type, "text") . PHP_EOL
59  ;
60  $res = $db->query($sql);
61 
62  if (!$db->fetchAssoc($res)) {
63  $values = [
64  "style_id" => ["integer", $row["obj_id"]],
65  "type" => ["text", $type],
66  "characteristic" => ["text", $class],
67  "hide" => ["integer", $hide]
68  ];
69  $db->insert("style_char", $values);
70 
71  $sql =
72  "SELECT id, style_id, tag, class, parameter, value, type, mq_id, custom" . PHP_EOL
73  . "FROM style_parameter" . PHP_EOL
74  . "WHERE style_id = " . $db->quote($row["obj_id"], "integer") . PHP_EOL
75  . "AND type = " . $db->quote($type, "text") . PHP_EOL
76  . "AND class = " . $db->quote($orig_class, "text") . PHP_EOL
77  . "AND tag = " . $db->quote($tag, "text") . PHP_EOL
78  ;
79 
80  $res = $db->query($sql);
81 
82  while ($row_2 = $db->fetchAssoc($res)) {
83  $spid = $db->nextId("style_parameter");
84  $values = [
85  "id" => ["integer", $spid],
86  "style_id" => ["integer", $row["obj_id"]],
87  "tag" => ["text", $tag],
88  "class" => ["text", $class],
89  "parameter" => ["text", $row_2["parameter"]],
90  "value" => ["text", $row_2["value"]],
91  "type" => ["text", $row_2["type"]]
92  ];
93  $db->insert("style_parameter", $values);
94  }
95  }
96  }
97  }
$res
Definition: ltiservices.php:69
$type

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