Skip to content

Commit

Permalink
help: multiple modules iv
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 committed Sep 27, 2023
1 parent 9505cd2 commit fd640e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Services/Help/Tooltips/TooltipsDBRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getTooltipPresentationText(
array $module_ids
): string {
$set = $this->db->query(
"SELECT tt.tt_text FROM help_tooltip tt JOIN help_module hmod " .
"SELECT tt.tt_text FROM help_tooltip tt LEFT JOIN help_module hmod " .
" ON (tt.module_id = hmod.id) " .
" WHERE tt.tt_id = " . $this->db->quote($a_tt_id, "text") .
" AND " . $this->db->in("tt.module_id", $module_ids, false, "integer") .
Expand All @@ -45,15 +45,15 @@ public function getTooltipPresentationText(
$rec = $this->db->fetchAssoc($set);
if (is_array($rec) && $rec["tt_text"] != "") {
$t = $rec["tt_text"];
if ($module_id === 0) {
if (count($module_ids) === 1 && current($module_ids) === 0) {
$t .= "<br/><i>(" . $a_tt_id . ")</i>";
}
return $t;
} else { // try to get general version
$fu = (int) strpos($a_tt_id, "_");
$gen_tt_id = "*" . substr($a_tt_id, $fu);
$set = $this->db->query(
"SELECT tt.tt_text FROM help_tooltip tt JOIN help_module hmod " .
"SELECT tt.tt_text FROM help_tooltip tt LEFT JOIN help_module hmod " .
" ON (tt.module_id = hmod.id) " .
" WHERE tt.tt_id = " . $this->db->quote($gen_tt_id, "text") .
" AND " . $this->db->in("tt.module_id", $module_ids, false, "integer") .
Expand All @@ -68,7 +68,7 @@ public function getTooltipPresentationText(
return $t;
}
}
if ($module_id === 0) {
if (count($module_ids) === 1 && current($module_ids) === 0) {
return "<i>" . $a_tt_id . "</i>";
}
return "";
Expand Down

0 comments on commit fd640e4

Please sign in to comment.