19 declare(strict_types=1);
    25     protected \ilDBInterface 
$db;
    37         $set = $this->db->query(
    39             "SELECT tt.tt_text FROM help_tooltip tt LEFT JOIN help_module hmod " .
    40             " ON (tt.module_id = hmod.id) " .
    41             " WHERE tt.tt_id = " . $this->db->quote($a_tt_id, 
"text") .
    42             " AND " . $this->db->in(
"tt.module_id", $module_ids, 
false, 
"integer") .
    43             " ORDER BY hmod.order_nr "    45         $rec = $this->db->fetchAssoc($set);
    46         if (is_array($rec) && $rec[
"tt_text"] != 
"") {
    48             if (count($module_ids) === 1 && current($module_ids) === 0) {
    49                 $t .= 
"<br/><i>(" . $a_tt_id . 
")</i>";
    53             $fu = (
int) strpos($a_tt_id, 
"_");
    54             $gen_tt_id = 
"*" . substr($a_tt_id, $fu);
    55             $set = $this->db->query(
    56                 "SELECT tt.tt_text FROM help_tooltip tt LEFT JOIN help_module hmod " .
    57                 " ON (tt.module_id = hmod.id) " .
    58                 " WHERE tt.tt_id = " . $this->db->quote($gen_tt_id, 
"text") .
    59                 " AND " . $this->db->in(
"tt.module_id", $module_ids, 
false, 
"integer") .
    60                 " ORDER BY hmod.order_nr "    62             $rec = $this->db->fetchAssoc($set);
    63             if (is_array($rec) && $rec[
"tt_text"] != 
"") {
    65                 if (count($module_ids) === 1 && current($module_ids) === 0) {
    66                     $t .= 
"<br/><i>(" . $a_tt_id . 
")</i>";
    71         if (count($module_ids) === 1 && current($module_ids) === 0) {
    72             return "<i>" . $a_tt_id . 
"</i>";
    81         $q = 
"SELECT * FROM help_tooltip";
    82         $q .= 
" WHERE module_id = " . $this->db->quote($a_module_id, 
"integer");
    84             $q .= 
" AND comp = " . $this->db->quote($a_comp, 
"text");
    86         $set = $this->db->query(
$q);
    88         while ($rec = $this->db->fetchAssoc($set)) {
    89             $tts[$rec[
"id"]] = array(
"id" => $rec[
"id"], 
"text" => $rec[
"tt_text"],
    90                                      "tt_id" => $rec[
"tt_id"]);
   100         $fu = strpos($a_tt_id, 
"_");
   101         $comp = substr($a_tt_id, 0, $fu);
   103         $nid = $this->db->nextId(
"help_tooltip");
   104         $this->db->manipulate(
"INSERT INTO help_tooltip " .
   105             "(id, tt_text, tt_id, comp,module_id) VALUES (" .
   106             $this->db->quote($nid, 
"integer") . 
"," .
   107             $this->db->quote($a_text, 
"text") . 
"," .
   108             $this->db->quote($a_tt_id, 
"text") . 
"," .
   109             $this->db->quote($comp, 
"text") . 
"," .
   110             $this->db->quote($a_module_id, 
"integer") .
   119         $fu = strpos($a_tt_id, 
"_");
   120         $comp = substr($a_tt_id, 0, $fu);
   122         $this->db->manipulate(
   123             "UPDATE help_tooltip SET " .
   124             " tt_text = " . $this->db->quote($a_text, 
"text") . 
", " .
   125             " tt_id = " . $this->db->quote($a_tt_id, 
"text") . 
", " .
   126             " comp = " . $this->db->quote($comp, 
"text") .
   127             " WHERE id = " . $this->db->quote($a_id, 
"integer")
   138         $set = $this->db->query(
"SELECT DISTINCT comp FROM help_tooltip " .
   139             " WHERE module_id = " . $this->db->quote($a_module_id, 
"integer") .
   142         while ($rec = $this->db->fetchAssoc($set)) {
   143             $comps[] = $rec[
"comp"];
   151         $this->db->manipulate(
   152             "DELETE FROM help_tooltip WHERE " .
   153             " id = " . $this->db->quote($a_id, 
"integer")
   160         $this->db->manipulate(
   161             "DELETE FROM help_tooltip WHERE " .
   162             " module_id = " . $this->db->quote($a_id, 
"integer")