3 declare(strict_types=1);
46 "SELECT obj_id" . PHP_EOL
47 .
"FROM object_data" . PHP_EOL
48 .
"WHERE type = 'sty'" . PHP_EOL
50 $set = $db->query($sql);
52 while ($row = $db->fetchAssoc($set)) {
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
60 $res = $db->query($sql);
62 if (!$db->fetchAssoc(
$res)) {
64 "style_id" => [
"integer", $row[
"obj_id"]],
65 "type" => [
"text",
$type],
66 "characteristic" => [
"text", $class],
67 "hide" => [
"integer", $hide]
69 $db->insert(
"style_char", $values);
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
80 $res = $db->query($sql);
82 while ($row_2 = $db->fetchAssoc(
$res)) {
83 $spid = $db->nextId(
"style_parameter");
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"]]
93 $db->insert(
"style_parameter", $values);
108 array $parameters = [],
115 "SELECT obj_id" . PHP_EOL
116 .
"FROM object_data" . PHP_EOL
117 .
"WHERE type = 'sty'" . PHP_EOL
119 $result = $db->query($sql);
121 while ($row = $db->fetchAssoc($result)) {
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);
130 if (!$db->fetchAssoc(
$res)) {
132 "style_id" => [
"integer", $row[
"obj_id"]],
133 "type" => [
"text",
$type],
134 "characteristic" => [
"text", $class],
135 "hide" => [
"integer", $hide]
137 $db->insert(
"style_char", $values);
139 foreach ($parameters as $k => $v) {
140 $spid = $db->nextId(
"style_parameter");
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]
150 $db->insert(
"style_parameter", $values);
static addStyleClass(string $class, string $type, string $tag, array $parameters=[], int $hide=0)
Add style class.
static copyStyleClass(string $orig_class, string $class, string $type, string $tag, int $hide=0)
Create style class GlossaryLink, link, IntLink.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...