19declare(strict_types=1);
37 $this->db =
$DIC->database();
38 $this->
user = $DIC->user();
46 $q =
"SELECT title FROM object_translation " .
47 "WHERE obj_id = " . $this->db->quote($this->obj_id,
'integer') .
" " .
48 "AND lang_default = 1";
49 $r = $this->db->query(
$q);
50 $row = $this->db->fetchObject($r);
52 $title = (string) $row->title;
55 $q =
"SELECT title FROM object_translation " .
56 "WHERE obj_id = " . $this->db->quote($this->obj_id,
'integer') .
" " .
58 $this->db->quote($this->
user->getCurrentLanguage(),
'text') .
" " .
59 "AND NOT lang_default = 1";
60 $r = $this->db->query(
$q);
61 $row = $this->db->fetchObject($r);
64 $title = (string) $row->title;
72 $q =
"SELECT * FROM object_translation WHERE obj_id = " .
73 $this->db->quote($this->obj_id,
'integer') .
" ORDER BY lang_default DESC";
74 $r = $this->db->query(
$q);
77 while ($row = $this->db->fetchObject($r)) {
78 $data[
"Fobject"][$num] = array(
"title" => $row->title,
80 (
string) $row->description,
84 "lang" => $row->lang_code
90 $data[
"default_language"] = 0;
97 $query =
"DELETE FROM object_translation WHERE obj_id= " .
98 $this->db->quote($this->obj_id,
'integer');
99 $this->db->manipulate($query);
104 $query =
"INSERT INTO object_translation " .
105 "(obj_id,title,description,lang_code,lang_default) " .
107 "(" . $this->db->quote($this->obj_id,
'integer') .
"," .
108 $this->db->quote($a_title,
'text') .
"," .
109 $this->db->quote(
'',
'text') .
"," .
110 $this->db->quote($a_lang,
'text') .
"," .
111 $this->db->quote($a_lang_default,
'integer') .
")";
112 $res = $this->db->manipulate($query);
Class ilObject Basic functions for all objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)