dolibarr 24.0.0-beta
freeze-tooltip.php
1<?php
2/*
3 * Copyright (C) 2024 Anthony Damhet <a.damhet@progiseize.fr>
4 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20// Load Dolibarr environment
21require '../../../../main.inc.php';
22
30// Protection if external user
31if ($user->socid > 0) {
33}
34
35// Includes
36require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php';
37
38// Load documentation translations
39$langs->load('uxdocumentation');
40
41//
42$documentation = new Documentation($db);
43$group = 'Content';
44
45$js = [
46// now included in Dolibarr in htdocs/core/js/lib_tooltip-freeze-by-alt-keypress.js
47];
48$css = [
49// now included in Dolibarr in htdocs/theme/eldy/tooltips.inc.css
50];
51
52// Output html head + body - Param is Title
53$documentation->docHeader($langs->trans('FreezeTooltip', $group), $js, $css);
54
55// Set view for menu and breadcrumb
56$documentation->view = [$group, 'FreezeTooltip'];
57
58// Output sidebar
59$documentation->showSidebar(); ?>
60
61<div class="doc-wrapper">
62
63 <?php $documentation->showBreadCrumb(); ?>
64
65 <div class="doc-content-wrapper">
66
67 <h1 class="documentation-title"><?php echo $langs->trans('FreezeTooltip'); ?></h1>
68
69 <?php $documentation->showSummary(); ?>
70
71 <div class="documentation-section" >
72 <h2 class="documentation-title" >Tooltip Freeze with <kbd>Alt</kbd> Key</h2>
73
74 <p>
75 A new feature allows users to <strong>freeze tooltips</strong> in Dolibarr by holding down the <kbd>Alt</kbd> key.
76 This makes it easier to read long tooltips without having to keep the cursor perfectly still.
77 </p>
78
79 <h3>How It Works</h3>
80 <ol>
81 <li>Hover over an element that displays a tooltip.</li>
82 <li>Press and hold the <kbd>Alt</kbd> key while the tooltip is visible.</li>
83 <li>The tooltip remains displayed even if you move the cursor away.</li>
84 <li>Release the <kbd>Alt</kbd> key to hide the tooltip.</li>
85 </ol>
86
87 <h3>Use Cases</h3>
88 <ul>
89 <li>Reading detailed information in tooltips without worrying about cursor movement.</li>
90 <li>Copying text from tooltips without them disappearing.</li>
91 <li>Click on links in tooltips.</li>
92 </ul>
93
94 <h3>Limitations</h3>
95 <ul>
96 <li>May not work on all tooltips, depending on their implementation. Only work on <code>.classfortooltip</code> class</li>
97 <li>Currently available only on experimental pages.</li>
98 </ul>
99
100 <h3>Example</h3>
101 <div class="documentation-example">
102 <?php
103 $tooltip = '<p>
104 Welcome to <a href="https://dolibarr.org" title="Official Dolibarr Website">Dolibarr</a>,
105 an open-source ERP & CRM solution. This platform helps businesses manage their
106 <abbr title="Customer Relationship Management">CRM</abbr>
107 and <abbr title="Enterprise Resource Planning">ERP</abbr> needs efficiently.
108</p>
109
110<p>
111 For documentation, visit our
112 <a href="https://wiki.dolibarr.org" title="Dolibarr Documentation">Wiki</a>.
113 Developers can contribute on
114 <a href="https://github.com/Dolibarr/dolibarr" title="Dolibarr GitHub Repository">GitHub</a>.
115</p>
116<p><strong class="classfortooltip" title="Tooltips in tooltips">try tooltip in a tooltip</strong></p>
117<p>
118 Need help? Check out the
119 <a href="https://www.dolibarr.org/forum.php" title="Dolibarr Community Forum">Community Forum</a>.
120</p>
121
122<p>
123 <strong>Try a link with attribute</strong> <code>target="_blank"</code> <br/>
124 <a href="https://www.dolibarr.org/" target="_blank" >Open website in a new window</a>.
125</p>
126
127';
128 ?>
129
130 <button type="button" class="button classfortooltip" title="<?php echo dol_htmlentities($tooltip); ?>">
131 Example of tooltip
132 </button>
133 </div>
134 </div>
135
136
137 </div>
138
139</div>
140<?php
141// Output close body + html
142$documentation->docFooter();
Class to manage UI documentation.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition repair.php:130
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.