3 declare(strict_types=1);
48 bool $outdated =
false 52 $db->
insert(
"style_char", [
53 "style_id" => [
"integer", $style_id],
54 "type" => [
"text", $type],
55 "characteristic" => [
"text", $char],
56 "hide" => [
"integer", $hidden],
57 "order_nr" => [
"integer", $order_nr],
58 "outdated" => [
"integer", $outdated]
70 "SELECT * FROM style_char " .
71 " WHERE style_id = %s AND type = %s AND characteristic = %s",
72 [
"integer",
"text",
"text"],
73 [$style_id, $type, $char]
84 string $characteristic
89 "SELECT * FROM style_char " .
90 " WHERE style_id = %s AND type = %s AND characteristic = %s ",
91 [
"integer",
"text",
"text"],
92 [$style_id, $type, $characteristic]
96 "SELECT * FROM style_char_title " .
97 " WHERE style_id = %s AND type = %s AND characteristic = %s ",
98 [
"integer",
"text",
"text"],
99 [$style_id, $type, $characteristic]
103 $titles[$rec2[
"lang"]] = $rec2[
"title"];
105 return $this->factory->characteristic(
111 (
int) $rec[
"order_nr"],
112 (
bool) $rec[
"outdated"]
131 bool $include_hidden =
true,
132 bool $include_outdated =
true 137 "SELECT * FROM style_char " .
138 " WHERE style_id = %s AND " . $db->
in(
"type", $types,
false,
"text") .
139 " ORDER BY order_nr, type, characteristic",
145 if (($rec[
"hide"] && !$include_hidden) ||
146 ($rec[
"outdated"] && !$include_outdated)) {
151 "SELECT * FROM style_char_title " .
152 " WHERE style_id = %s AND type = %s AND characteristic = %s ",
153 [
"integer",
"text",
"text"],
154 [$style_id, $rec[
"type"], $rec[
"characteristic"]]
158 $titles[$rec2[
"lang"]] = $rec2[
"title"];
160 $chars[] = $this->factory->characteristic(
162 $rec[
"characteristic"],
166 (
int) $rec[
"order_nr"],
167 (
bool) $rec[
"outdated"]
182 $types = $stypes[$super_type];
197 string $characteristic,
203 "DELETE FROM style_char_title " .
204 " WHERE style_id = %s AND type = %s AND characteristic = %s ",
205 [
"integer",
"text",
"text"],
206 [$style_id, $type, $characteristic]
209 foreach ($titles as $l => $title) {
223 string $characteristic,
229 $db->
insert(
"style_char_title", [
230 "style_id" => [
"integer", $style_id],
231 "type" => [
"text", $type],
232 "characteristic" => [
"text", $characteristic],
233 "lang" => [
"text", $lang],
234 "title" => [
"text", $title]
243 $set = $this->db->queryF(
"SELECT * FROM style_char " .
244 " WHERE style_id = %s ",
248 while ($rec = $this->db->fetchAssoc($set)) {
249 $this->db->insert(
"style_char", [
250 "style_id" => [
"integer", $to_style_id],
251 "type" => [
"text", $rec[
"type"]],
252 "characteristic" => [
"text", $rec[
"characteristic"]],
253 "hide" => [
"integer", (
int) ($rec[
"hide"] ?? 0)],
254 "outdated" => [
"integer", (
int) ($rec[
"outdated"] ?? 0)],
255 "order_nr" => [
"integer", (
int) ($rec[
"order_nr"] ?? 0)]
258 $set = $this->db->queryF(
"SELECT * FROM style_char_title " .
259 " WHERE style_id = %s ",
263 while ($rec = $this->db->fetchAssoc($set)) {
264 $this->db->insert(
"style_char_title", [
265 "style_id" => [
"integer", $to_style_id],
266 "type" => [
"text", $rec[
"type"]],
267 "characteristic" => [
"text", $rec[
"characteristic"]],
268 "lang" => [
"text", $rec[
"lang"]],
269 "title" => [
"text", $rec[
"title"]]
280 string $characteristic,
288 "hide" => [
"integer", $hide]
291 "style_id" => [
"integer", $style_id],
292 "type" => [
"text", $type],
293 "characteristic" => [
"text", $characteristic]
304 string $characteristic,
312 "outdated" => [
"integer", $outdated]
315 "style_id" => [
"integer", $style_id],
316 "type" => [
"text", $type],
317 "characteristic" => [
"text", $characteristic]
325 string $characteristic
329 $set = $db->
queryF(
"SELECT outdated FROM style_char " .
330 " WHERE style_id = %s AND type = %s AND characteristic = %s",
331 [
"integer",
"text",
"text"],
332 [$style_id, $type, $characteristic]
335 return (
bool) $rec[
"outdated"];
343 string $characteristic,
351 "order_nr" => [
"integer", $order_nr]
354 "style_id" => [
"integer", $style_id],
355 "type" => [
"text", $type],
356 "characteristic" => [
"text", $characteristic]
371 "DELETE FROM style_char WHERE style_id = %s AND type = %s AND characteristic = %s",
372 array(
"integer",
"text",
"text"),
373 array($style_id, $type, $class)
378 "DELETE FROM style_parameter WHERE style_id = %s AND tag = %s AND type = %s AND class = %s",
379 array(
"integer",
"text",
"text",
"text"),
380 array($style_id, $tag, $type, $class)
396 bool $a_custom =
false 401 "SELECT * FROM style_parameter " .
402 " WHERE style_id = %s AND tag = %s AND class = %s AND mq_id = %s " .
403 " AND custom = %s AND type = %s AND parameter = %s ",
404 [
"integer",
"text",
"text",
"integer",
"integer",
"text",
"text"],
405 [$style_id, $a_tag, $a_class, $a_mq_id, $a_custom, $a_type, $a_par]
408 if ($set->fetchRow()) {
412 "value" => [
"text", $a_val]
415 "style_id" => [
"integer", $style_id],
416 "tag" => [
"text", $a_tag],
417 "class" => [
"text", $a_class],
418 "mq_id" => [
"integer", $a_mq_id],
419 "custom" => [
"integer", $a_custom],
420 "type" => [
"text", $a_type],
421 "parameter" => [
"text", $a_par]
426 $db->
insert(
"style_parameter", [
427 "id" => [
"integer",
$id],
428 "value" => [
"text", $a_val],
429 "style_id" => [
"integer", $style_id],
430 "tag" => [
"text", $a_tag],
431 "class" => [
"text", $a_class],
432 "type" => [
"text", $a_type],
433 "parameter" => [
"text", $a_par],
434 "mq_id" => [
"integer", $a_mq_id],
435 "custom" => [
"integer", $a_custom]
451 $q =
"DELETE FROM style_parameter WHERE " .
452 " style_id = " . $db->
quote($style_id,
"integer") .
" AND " .
453 " tag = " . $db->
quote($tag,
"text") .
" AND " .
454 " class = " . $db->
quote($class,
"text") .
" AND " .
455 " mq_id = " . $db->
quote($mq_id,
"integer") .
" AND " .
456 " custom = " . $db->
quote($custom,
"integer") .
" AND " .
457 " " . $db->
equals(
"type", $type,
"text",
true) .
" AND " .
458 " parameter = " . $db->
quote($par,
"text");
468 if ($old_name == $new_name) {
474 $color_attributes = [
479 "border-bottom-color",
481 "border-right-color",
485 "SELECT * FROM style_parameter " .
486 " WHERE style_id = %s AND " . $db->
in(
"parameter", $color_attributes,
false,
"text"),
491 if ($rec[
"value"] ==
"!" . $old_name ||
492 is_int(strpos($rec[
"value"],
"!" . $old_name .
"("))) {
499 str_replace($old_name, $new_name, $rec[
"value"]),
addCharacteristic(int $style_id, string $type, string $char, bool $hidden=false, int $order_nr=0, bool $outdated=false)
saveOrderNr(int $style_id, string $type, string $characteristic, int $order_nr)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insert(string $table_name, array $values)
manipulateF(string $query, array $types, array $values)
__construct(ilDBInterface $db, InternalDataService $factory)
replaceParameter(int $style_id, string $a_tag, string $a_class, string $a_par, string $a_val, string $a_type, int $a_mq_id=0, bool $a_custom=false)
equals(string $columns, $value, string $type, bool $emptyOrNull=false)
fetchAssoc(ilDBStatement $statement)
getByKey(int $style_id, string $type, string $characteristic)
saveOutdated(int $style_id, string $type, string $characteristic, bool $outdated)
Save characteristic outdated status.
update(string $table_name, array $values, array $where)
$where MUST contain existing columns only.
addTitle(int $style_id, string $type, string $characteristic, string $lang, string $title)
quote($value, string $type)
static _getStyleSuperTypes()
exists(int $style_id, string $type, string $char)
deleteParameter(int $style_id, string $tag, string $class, string $par, string $type, int $mq_id=0, bool $custom=false)
getByTypes(int $style_id, array $types, bool $include_hidden=true, bool $include_outdated=true)
saveTitles(int $style_id, string $type, string $characteristic, array $titles)
Save titles for characteristic.
saveHidden(int $style_id, string $type, string $characteristic, bool $hide)
Save characteristic hidden status.
nextId(string $table_name)
InternalDataService $factory
cloneAllFromStyle(int $from_style_id, int $to_style_id)
queryF(string $query, array $types, array $values)
Repository internal data service.
Characteristic (Class) of style.
getByType(int $style_id, string $type)
in(string $field, array $values, bool $negate=false, string $type="")
isOutdated(int $style_id, string $type, string $characteristic)
getBySuperType(int $style_id, string $super_type)
Get characteristics by supertype.
deleteCharacteristic(int $style_id, string $type, string $tag, string $class)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
manipulate(string $query)
Run a (write) Query on the database.
updateColorName(int $style_id, string $old_name, string $new_name)