ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 public 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 $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 }
62
69 public function addStyleClass($a_class, $a_type, $a_tag, $a_parameters = "", $a_hide = 0)
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 }
110}
An exception for terminatinating execution or to throw for unit testing.
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
$a_type
Definition: workflow.php:92