dolibarr 25.0.0-alpha
dropdown.inc.php
1<?php
2/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
3 */
4if (!defined('ISLOADEDBYSTEELSHEET')) {
5 die('Must be call by steelsheet');
6}
7include_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php";
8
18'
19@phan-var-force string $colorbackhmenu1
20@phan-var-force string $colorbacklinepair1
21@phan-var-force string $colortextbackhmenu
22@phan-var-force string $colortextlink
23@phan-var-force int<0,1> $disableimages
24@phan-var-force string $left
25@phan-var-force string $right
26';
27
28$borderradius = getDolGlobalString('THEME_ELDY_USEBORDERONTABLE') ? getDolGlobalInt('THEME_ELDY_BORDER_RADIUS', 6) : 0;
29$WIDTHMENUDROPDOWN = 370;
30?>
31
32/* IDE Hack <style type="text/css"> */
33
34/*
35 * Dropdown of user popup
36 */
37
38.bookmark-footer a.top-menu-dropdown-link {
39 white-space: normal;
40 word-break: break-word;
41}
42
43button.dropdown-item.global-search-item {
44 outline: none;
45}
46
47.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-quickadd, .open>.dropdown-menu, .dropdown dd ul.open {
48 display: block;
49}
50
51#topmenu-bookmark-dropdown .dropdown-menu {
52 min-width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
53 max-width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
54 width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
55 border-bottom-left-radius: 6px;
56 border-bottom-right-radius: 6px;
57}
58
59
60.dropdown-search {
61 border-color: #eee;
62
63 position: absolute;
64 top: 100%;
65 left: 0;
66 z-index: 1000;
67 display: none;
68 float: left;
69 min-width: 160px;
70 margin: 2px 0 0;
71 font-size: 14px;
72 text-align: left;
73 list-style: none;
74 background-color: #fff;
75 -webkit-background-clip: padding-box;
76 background-clip: padding-box;
77 border: 1px solid #ccc;
78 border: 1px solid rgba(0,0,0,.15);
79 border-radius: 4px;
80 box-shadow: 0 6px 12px rgba(0,0,0,.175);
81}
82.dropdown-bookmark {
83 border-color: #eee;
84
85 position: absolute;
86 top: 100%;
87 left: 0;
88 z-index: 1000;
89 display: none;
90 float: left;
91 min-width: 160px;
92 margin: 2px 0 0;
93 font-size: 14px;
94 text-align: left;
95 list-style: none;
96 background-color: #fff;
97 -webkit-background-clip: padding-box;
98 background-clip: padding-box;
99 border: 1px solid #ccc;
100 border: 1px solid rgba(0,0,0,.15);
101 border-radius: 4px;
102 box-shadow: 0 6px 12px rgba(0,0,0,.175);
103}
104.dropdown-quickadd {
105 border-color: #eee;
106
107 position: absolute;
108 top: 100%;
109 left: 0;
110 z-index: 1000;
111 display: none;
112 float: left;
113 min-width: 240px;
114 margin: 2px 0 0;
115 font-size: 14px;
116 text-align: left;
117 list-style: none;
118 background-color: #fff;
119 -webkit-background-clip: padding-box;
120 background-clip: padding-box;
121 border: 1px solid #ccc;
122 border: 1px solid rgba(0,0,0,.15);
123 border-radius: 4px;
124 box-shadow: 0 6px 12px rgba(0,0,0,.175);
125}
126.dropdown-menu {
127 position: absolute;
128 top: 100%;
129 left: 0;
130 z-index: 1000;
131 display: none;
132 float: left;
133 min-width: 160px;
134 margin: 2px 0 0 !important;
135 font-size: 14px;
136 text-align: <?php echo $left; ?>;
137 list-style: none;
138 background-color: #fff;
139 -webkit-background-clip: padding-box;
140 background-clip: padding-box;
141 border: 1px solid rgba(128, 128, 128, .15);
142 border-radius: 10px !important;
143 box-shadow: 0 6px 12px rgba(0,0,0,.175);
144}
145
146.ai_dropdown{
147 margin-top: 14px !important;
148 margin-left: -2px !important;
149}
150
151.dropdown-toggle{
152 text-decoration: none !important;
153}
154
155
156/* CSS to hide the arrow to show open/close */
157div#topmenu-global-search-dropdown a::after, div#topmenu-quickadd-dropdown a::after, div#topmenu-bookmark-dropdown a::after, div#topmenu-quickmemo-dropdown a.dropdown-toggle::after {
158 display: none;
159}
160
161
162.dropdown-toggle::after {
163 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
164 font-size: 0.7em;
165 font-weight: 900;
166 font-style: normal;
167 font-variant: normal;
168 text-rendering: auto;
169 -webkit-font-smoothing: antialiased;
170 text-align:center;
171 text-decoration:none;
172 margin: auto 3px;
173 display: inline-block;
174 content: "\f078";
175
176 -webkit-transition: -webkit-transform .2s ease-in-out;
177 -ms-transition: -ms-transform .2s ease-in-out;
178 transition: transform .2s ease-in-out;
179}
180
181
182.open>.dropdown-toggle::after {
183 transform: rotate(180deg);
184}
185
186/*
187 * MENU Dropdown
188 */
189
190.login_block.usedropdown .logout-btn{
191 display: none;
192}
193
194.tmenu .open.dropdown, .tmenu .open.dropdown {
195 background: rgba(0, 0, 0, 0.1);
196}
197.tmenu .dropdown-menu, .login_block .dropdown-menu, .topnav .dropdown-menu {
198 position: absolute;
199 right: 1px;
200 <?php echo $left; ?>: auto;
201 line-height:1.3em;
202}
203.tmenu .dropdown-menu, .login_block .dropdown-menu .user-body {
204 border-bottom-right-radius: 4px;
205 border-bottom-left-radius: 4px;
206}
207.user-body {
208 color: #333;
209}
210.side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu {
211 border-top-right-radius: 0;
212 border-top-left-radius: 0;
213 padding: 0 0 0 0;
214 /* border-top-width: 0; */
215 width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
216 border-radius: 6px;
217}
218.topnav .user-menu .dropdown-menu {
219 top: 50px;
220}
221.side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu {
222 margin-top: 0;
223 border-top-left-radius: 0;
224 border-top-right-radius: 0;
225}
226
227.side-nav-vert .user-menu .dropdown-menu > .user-header, .topnav .user-menu .dropdown-menu > .user-header {
228 min-height: 100px;
229 padding: 10px;
230 text-align: center;
231 white-space: normal;
232}
233
234#topmenu-global-search-dropdown .dropdown-menu{
235 width: 370px;
236 max-width: 370px;
237}
238
239div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown, div#topmenu-quickadd-dropdown {
240 <?php if (!$disableimages) { ?>
241 line-height: 46px;
242 <?php } else { ?>
243 margin-top: -2px;
244 <?php } ?>
245}
246a.top-menu-dropdown-link {
247 padding: 8px;
248}
249
250.dropdown-user-image {
251 border-radius: 50%;
252 vertical-align: middle;
253 z-index: 5;
254 height: 90px;
255 width: 90px;
256 border: 3px solid;
257 border-color: transparent;
258 border-color: rgba(255, 255, 255, 0.2);
259 max-width: 100%;
260 max-height :100%;
261}
262
263.dropdown-menu > .user-header{
264 /* background: var(--colorbackhmenu1);
265 color: var(--colortextbackhmenu); */
266 background: #f9f9f9;
267 color: #000;
268 border-top-left-radius: 6px;
269 border-top-right-radius: 6px;
270}
271
272.dropdown-menu .dropdown-header{
273 padding: 8px 12px 8px 16px;
274}
275
276.dropdown-menu > .user-footer {
277 border-top: 1px solid #f0f0f0;
278 background-color: #f9f9f9;
279 padding: 20px;
280 border-bottom-left-radius: 6px;
281 border-bottom-right-radius: 6px;
282}
283
284.user-footer:after {
285 clear: both;
286}
287
288.dropdown-menu > .bookmark-footer {
289 border-top: 1px solid #f0f0f0;
290 background-color: #f9f9f9;
291 padding: 10px;
292 text-align: start;
293}
294
295
296.dropdown-menu > .user-body, .dropdown-body {
297 padding: 20px;
298 border-bottom: 1px solid #f4f4f4;
299 border-top: 1px solid #f0f0f0;
300 white-space: normal;
301 border-bottom-left-radius: 6px;
302 border-bottom-right-radius: 6px;
303}
304
305.dropdown-menu > .bookmark-body, .dropdown-body {
306 overflow-y: auto;
307 max-height: 60vh ; /* fallback for browsers without support for calc() */
308 max-height: calc(90vh - 110px) ;
309 white-space: normal;
310}
311#topmenu-quickadd-dropdown .dropdown-menu > .bookmark-body, #topmenu-quickadd-dropdown .dropdown-body,
312#topmenu-bookmark-dropdown .dropdown-menu > .bookmark-body, #topmenu-bookmark-dropdown .dropdown-body {
313 max-height: 60vh ; /* fallback for browsers without support for calc() */
314 max-height: calc(90vh - 200px) ;
315}
316
317
318.dropdown-body::-webkit-scrollbar {
319 width: 8px;
320 }
321.dropdown-body::-webkit-scrollbar-thumb {
322 -webkit-border-radius: 0;
323 border-radius: 0;
324 /* background: rgb(<?php echo $colorbackhmenu1 ?>); */
325 background: #aaa;
326}
327.dropdown-body::-webkit-scrollbar-track {
328 -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
329 -webkit-border-radius: 0;
330 border-radius: 0;
331}
332
333#topmenu-tool,
334#topmenu-global-search-dropdown,
335#topmenu-ai-dropdown,
336#topmenu-quickadd-dropdown,
337#topmenu-bookmark-dropdown,
338#topmenu-uploadfile-dropdown,
339#topmenu-quickmemo-dropdown,
340#topmenu-login-dropdown {
341 padding: 0 5px 0 5px;
342}
343#topmenu-login-dropdown a:hover{
344 text-decoration: none;
345}
346
347#topmenuloginmoreinfo-btn, #topmenulogincompanyinfo-btn {
348 display: block;
349 text-align: start;
350 color:#666;
351 cursor: pointer;
352}
353
354#topmenuloginmoreinfo, #topmenulogincompanyinfo {
355 display: none;
356 clear: both;
357 font-size: 0.95em;
358}
359
360a.dropdown-item {
361 text-align: start;
362}
363
364.button-top-menu-dropdown {
365 display: inline-block;
366 padding: 6px 12px;
367 margin-bottom: 0;
368 font-size: 14px;
369 font-weight: 400;
370 line-height: 1.42857143;
371 text-align: center;
372 white-space: nowrap;
373 vertical-align: middle;
374 -ms-touch-action: manipulation;
375 touch-action: manipulation;
376 cursor: pointer;
377 -webkit-user-select: none;
378 -moz-user-select: none;
379 -ms-user-select: none;
380 user-select: none;
381 background-image: none;
382 border: 1px solid transparent;
383 border-radius: 3px;
384}
385
386.user-footer .button-top-menu-dropdown {
387 color: #666666;
388 box-shadow: none;
389 border-width: 1px;
390 background-color: #f4f4f4;
391 border-color: #ddd;
392}
393
394.dropdown-menu a.top-menu-dropdown-link {
395 color: rgb(<?php print $colortextlink; ?>) !important;
396 box-shadow: none;
397 display: block;
398 margin: 5px 0px;
399}
400
401.dropdown-item {
402 display: block !important;
403 box-sizing: border-box;
404 width: 100%;
405 padding: .5em 1.5em .5em 1em;
406 clear: both;
407 font-weight: 400;
408 color: #212529 !important;
409 text-align: inherit;
410 background-color: transparent;
411 border: 0;
412 box-shadow: none;
413}
414.dropdown-item.bookmark-item {
415 padding-left: 0;
416 padding-right: 0;
417}
418.dropdown-item.bookmark-item:before {
419 width: 20px;
420 padding-left: 2px;
421}
422
423
424.dropdown-item::before {
425 /* font part */
426 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
427 font-weight: 900;
428 font-style: normal;
429 font-variant: normal;
430 text-rendering: auto;
431 -webkit-font-smoothing: antialiased;
432 text-align:center;
433 text-decoration:none;
434 margin-<?php echo $right; ?>: 5px;
435 display: inline-block;
436 content: "\f0da";
437 /* color: rgba(0,0,0,0.3); */
438}
439.multicompany-item::before {
440 content: none !important;
441}
442
443.dropdown-item.bookmark-item-external::before {
444 content: "\f35d";
445}
446
447.dropdown-item.active, .dropdown-item:hover, .dropdown-item:hover span::before, .dropdown-item:focus, .dropdown-item:focus span::before {
448 color: #<?php echo $colortextbackhmenu; ?> !important;
449 text-decoration: none;
450 background: rgb(<?php echo $colorbackhmenu1 ?>);
451}
452
453
454/*
455 * SELECT FIELDS
456 */
457
458li.liinputsearch, div.liinputsearch {
459 position: sticky;
460 display: block;
461 top: 0;
462 background: var(--colorbackbody);
463 z-index: 1;
464}
465
466
467
468/*
469 * QUICK ADD
470 */
471
472#topmenu-quickadd-dropdown .dropdown-menu {
473 width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
474 color: #444;
475}
476
477.quickadd-body.dropdown-body {
478 padding: unset;
479 padding-top: 10px;
480 padding-bottom: 10px;
481}
482
483.quickadd-item {
484 font-size: 1.1em;
485}
486
487.quickadd-item:before {
488 content: none;
489}
490
491.quickadd-header {
492 color: #444 !important;
493}
494
495div.quickadd {
496 display: -ms-flexbox;
497 display: -webkit-flex;
498 display: flex;
499 -webkit-flex-direction: row;
500 -ms-flex-direction: row;
501 flex-direction: row;
502 -webkit-flex-wrap: wrap;
503 -ms-flex-wrap: wrap;
504 flex-wrap: wrap;
505 -webkit-justify-content: center;
506 -ms-flex-pack: center;
507 justify-content: center;
508 -webkit-align-content: center;
509 -ms-flex-line-pack: center;
510 align-content: center;
511 -webkit-align-items: flex-start;
512 -ms-flex-align: start;
513 align-items: flex-start;
514}
515
516div.quickadd a {
517 color: #444;
518}
519
520div.quickadd a:hover, div.quickadd a:active {
521 color: #000000;
522}
523
524div.quickaddblock {
525 width: 95px;
526 height: 80px;
527}
528
529div.quickaddblock:hover,
530div.quickaddblock:active,
531div.quickaddblock:focus {
532 background: <?php print "#".colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?>;
533}
534
535
536/* for the dropdown on action buttons */
537.dropdown-holder {
538 position: relative;
539 display: inline-block;
540}
541
542.dropdown-content {
543 display: none;
544 position: absolute;
545 z-index: 5;
546 width: 300px;
547 right:0; /* will be set with js */
548 bottom: 0;
549 transform: translateY(100%);
550
551 text-align: <?php echo $left; ?>;
552 background: #fff;
553 /* border: 1px solid #bbb; */
554 border-radius: 6px;
555 box-shadow: 0 1px 10px rgb(0, 0, 0, 0.3);
556}
557
558/* dropdown --up variant */
559.dropdown-holder.--up .dropdown-content{
560 bottom: auto;
561 top: 0;
562 transform: translateY(-100%);
563}
564
565/* dropdown --left variant */
566.dropdown-holder.--left .dropdown-content{
567 right: auto;
568 left: 12px;
569}
570
571
572.dropdown-content a {
573 margin-right: auto !important;
574 margin-left: auto !important;
575}
576.dropdown-content .butAction {
577 background: none;
578 color: #333 !important;
579}
580.dropdown-content a:is(.butAction,.butActionDelete,.butActionRefused),
581.dropdown-content span:is(.butAction,.butActionDelete,.butActionRefused) {
582 display: flex;
583 border-radius: 0;
584}
585
586.dropdown-content .butAction:hover {
587 box-shadow: none;
588 background-color: var(--butactionbg);
589 color: var(--textbutaction) !important;
590 text-decoration: none;
591}
592
593.dropdown-content .butActionDelete{
594 background-color: transparent !important;
595 color: #633 !important;
596}
597.dropdown-content .butActionDelete:hover {
598 box-shadow: none;
599 background-color: var(--butactiondeletebg) !important;
600 color: #633 !important;
601 text-decoration: none;
602}
603
604.dropdown-content .butActionRefused {
605 margin-left: 0;
606 margin-right: 0;
607 border: none;
608}
609
610.dropdown-holder.open .dropdown-content {
611 display: block;
612}
613
615.dropdown-holder.open .dropdown-content::before {
616 --triangleBorderSize : 5px;
617 position: absolute;
618 content: "";
619 top: calc(var(--triangleBorderSize) * -1);
620 right: 12px;
621 width: 0px;
622 height: 0px;
623 border-style: solid;
624 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
625 border-color: transparent transparent #ffff transparent;
626 transform: rotate(0deg);
627}
628
629/* dropdown --up variant*/
630.dropdown-holder.--up.open .dropdown-content::before{
631 top: auto;
632 bottom: calc(var(--triangleBorderSize) * -1);
633 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
634 transform: rotate(180deg);
635}
636
637/* dropdown --left variant*/
638.dropdown-holder.--left.open .dropdown-content::before{
639 right: auto;
640 left: 12px;
641}
642
643.dropdown-search-input {
644 border-radius: <?php print $borderradius; ?>px;
645}
646
647/* smartphone */
648@media only screen and (max-width: 767px)
649{
650 .dropdown-search-input,.search-tool-input {
651 width: 100%;
652 }
653
654 .tmenu .dropdown-menu, .login_block .dropdown-menu, .topnav .dropdown-menu {
655 margin-left: 8px;
656 right: 0;
657 }
658
659 #topmenu-bookmark-dropdown .dropdown-menu, #topmenu-quickadd-dropdown .dropdown-menu {
660 min-width: 220px;
661 max-width: 360px;
662 }
663
664 .side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu {
665 width: 300px;
666 }
667 .dropdown-menu:not(.ai_dropdown) {
668 border: none;
669 box-shadow: none;
670 border-bottom: 1px solid #888;
671 }
672
673}
print $object position
Definition edit.php:206
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:166
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
editval_textarea active