dolibarr 24.0.0-beta
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
9// When no photo, we show the login name, so we need an offset to output picto at a fixed position.
10$atoploginusername = empty($user->photo) ? 52 : 0;
11
21'
22@phan-var-force string $colorbackhmenu1
23@phan-var-force string $colorbacklinepair1
24@phan-var-force string $colortextbackhmenu
25@phan-var-force string $colortextlink
26@phan-var-force int<0,1> $disableimages
27@phan-var-force string $left
28@phan-var-force string $right
29';
30
31$borderradius = getDolGlobalString('THEME_ELDY_USEBORDERONTABLE') ? getDolGlobalInt('THEME_ELDY_BORDER_RADIUS', 6) : 0;
32$WIDTHMENUDROPDOWN = 370;
33?>
34
35/* IDE Hack <style type="text/css"> */
36
37/*
38 * Dropdown of user popup
39 */
40
41.bookmark-footer a.top-menu-dropdown-link {
42 white-space: normal;
43 word-break: break-word;
44}
45
46button.dropdown-item.global-search-item {
47 outline: none;
48}
49
50.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu, .dropdown dd ul.open {
51 display: block;
52}
53
54#topmenu-tool a,
55#topmenu-global-search-dropdown a.login-dropdown-a,
56#topmenu-quickadd-dropdown a.login-dropdown-a,
57#topmenu-bookmark-dropdown a.login-dropdown-a,
58#topmenu-ai-dropdown a.login-dropdown-a,
59#topmenu-uploadfile-dropdown a.login-dropdown-a {
60 color: var(--colortextbackhmenu);
61}
62
63div.login_block_tools > div {
64 position: fixed;
65 <?php echo $right; ?>: <?php print !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? (55 + $atoploginusername) : 85; ?>px;
66 top: 0px;
67}
68
69div#topmenu-login-dropdown {
70 position: fixed;
71 <?php echo $right; ?>: 10px;
72 top: 0px;
73}
74
75
76#topmenu-login-dropdown .dropdown-toggle:after {
77 display: none;
78}
79
80#topmenu-global-search-dropdown .dropdown-menu, #topmenu-quickadd-dropdown .dropdown-menu, #topmenu-bookmark-dropdown .dropdown-menu, #topmenu-login-dropdown .dropdown-menu {
81 min-width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
82 max-width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
83 width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
84}
85
86button.dropdown-item.global-search-item {
87 outline: none;
88}
89
90.open>.dropdown-search, .open>.dropdown-quickadd, .open>.dropdown-bookmark, .open>.dropdown-menu{
91 display: block !important;
92}
93
94.dropdown-search {
95 border-color: #eee;
96
97 position: absolute;
98 top: 100%;
99 left: 0;
100 z-index: 1000;
101 display: none;
102 float: left;
103 min-width: 160px;
104 margin: 2px 0 0;
105 font-size: 14px;
106 text-align: left;
107 list-style: none;
108 background-color: #fff;
109 -webkit-background-clip: padding-box;
110 background-clip: padding-box;
111 border: 1px solid #ccc;
112 border: 1px solid rgba(0,0,0,.15);
113 border-radius: 4px;
114 box-shadow: 0 6px 12px rgba(0,0,0,.175);
115}
116.dropdown-bookmark {
117 border-color: #eee;
118
119 position: absolute;
120 top: 100%;
121 left: 0;
122 z-index: 1000;
123 display: none;
124 float: left;
125 min-width: 160px;
126 margin: 2px 0 0;
127 font-size: 14px;
128 text-align: left;
129 list-style: none;
130 background-color: #fff;
131 -webkit-background-clip: padding-box;
132 background-clip: padding-box;
133 border: 1px solid #ccc;
134 border: 1px solid rgba(0,0,0,.15);
135 border-radius: 4px;
136 box-shadow: 0 6px 12px rgba(0,0,0,.175);
137}
138.dropdown-menu {
139 border-color: #eee;
140
141 position: absolute;
142 top: 100%;
143 left: 0;
144 z-index: 1000;
145 display: none;
146 float: left;
147 min-width: 160px;
148 margin: 2px 0 0;
149 font-size: 14px;
150 text-align: left;
151 list-style: none;
152 background-color: #fff;
153 -webkit-background-clip: padding-box;
154 background-clip: padding-box;
155 border: 1px solid #ccc;
156 border: 1px solid rgba(128, 128, 128, .15);
157 border-radius: 10px;
158 box-shadow: 0 6px 12px rgba(0,0,0,.175);
159}
160
161.ai_dropdown{
162 margin-top: 14px !important;
163 margin-left: -2px !important;
164}
165
166/* CSS to hide the arrow to show open/close */
167div#topmenu-global-search-dropdown, div#topmenu-quickadd-dropdown, div#topmenu-bookmark-dropdown, div#topmenu-ai-dropdown {
168 padding-right: 2px;
169}
170div#topmenu-global-search-dropdown a::after, div#topmenu-quickadd-dropdown a::after, div#topmenu-bookmark-dropdown a::after {
171 display: none;
172}
173
174
175.dropdown-toggle{
176 text-decoration: none !important;
177}
178
179.dropdown-toggle::after {
180 /* font part */
181 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
182 font-size: 0.7em;
183 line-height: 1.7em;
184 font-weight: 900;
185 font-style: normal;
186 font-variant: normal;
187 text-rendering: auto;
188 -webkit-font-smoothing: antialiased;
189 text-align:center;
190 text-decoration:none;
191 margin: auto 3px;
192 display: inline-block;
193 content: "\f078";
194
195 -webkit-transition: -webkit-transform .2s ease-in-out;
196 -ms-transition: -ms-transform .2s ease-in-out;
197 transition: transform .2s ease-in-out;
198}
199
200.open>.dropdown-toggle::after {
201 transform: rotate(180deg);
202}
203
204/*
205 * MENU Dropdown
206 */
207
208.login_block.usedropdown .logout-btn{
209 /* display: none; */
210}
211
212.tmenu .open.dropdown, .tmenu .open.dropdown {
213 background: rgba(0, 0, 0, 0.1);
214}
215.tmenu .dropdown-menu, .login_block .dropdown-menu {
216 position: absolute;
217 right: 0;
218 <?php echo $left; ?>: auto;
219 line-height:1.3em;
220}
221.tmenu .dropdown-menu, .login_block .dropdown-menu .user-body {
222 border-bottom-right-radius: 4px;
223 border-bottom-left-radius: 4px;
224}
225.user-body {
226 color: #333;
227}
228.side-nav-vert .user-menu .dropdown-menu {
229 border-top-right-radius: 0;
230 border-top-left-radius: 0;
231 padding: 1px 0 0 0;
232 border-top-width: 0;
233 width: 300px;
234}
235.side-nav-vert .user-menu .dropdown-menu {
236 margin-top: 0;
237 border-top-left-radius: 0;
238 border-top-right-radius: 0;
239}
240
241.side-nav-vert .user-menu .dropdown-menu > .user-header {
242 min-height: 100px;
243 padding: 10px;
244 text-align: center;
245 white-space: normal;
246}
247
248#topmenu-global-search-dropdown .dropdown-menu{
249 width: 300px;
250 max-width: 100%;
251}
252
253div#topmenu-global-search-dropdown,
254div#topmenu-quickadd-dropdown,
255div#topmenu-bookmark-dropdown,
256div#topmenu-uploadfile-dropdown,
257div#topmenu-login-dropdown {
258 <?php if ($disableimages) { ?>
259 line-height: 35px;
260 <?php } else { ?>
261 line-height: 49px;
262 <?php } ?>
263}
264a.top-menu-dropdown-link {
265 padding: 8px;
266}
267
268.dropdown-user-image {
269 border-radius: 50%;
270 vertical-align: middle;
271 z-index: 5;
272 height: 90px;
273 width: 90px;
274 border: 3px solid;
275 border-color: transparent;
276 border-color: rgba(255, 255, 255, 0.2);
277 max-width: 100%;
278 max-height :100%;
279}
280
281.dropdown-menu > .user-header{
282 /*background: var(--colorbackhmenu1);
283 color: var(--colortextbackhmenu);*/
284 background: #f9f9f9;
285 color: #000;
286}
287
288
289.dropdown-menu .dropdown-header{
290 padding: 8px 10px 10px 10px;
291}
292
293.dropdown-menu > .user-footer {
294 background-color: #f9f9f9;
295 padding: 20px;
296}
297
298.user-footer:after {
299 clear: both;
300}
301
302
303.dropdown-menu > .bookmark-footer{
304 border-top: 1px solid #f0f0f0;
305 background-color: #f9f9f9;
306 padding: 10px;
307 text-align: start;
308}
309
310.dropdown-menu > .user-body {
311 padding: 20px;
312}
313.dropdown-menu > .user-body, .dropdown-body{
314 border-bottom: 1px solid #f4f4f4;
315 border-top: 1px solid #f0f0f0;
316 white-space: normal;
317}
318#top-bookmark-search-nothing-found {
319 padding: 15px;
320 display: block;
321}
322
323.dropdown-menu > .bookmark-body, .dropdown-body{
324 overflow-y: auto;
325 max-height: 60vh ; /* fallback for browsers without support for calc() */
326 max-height: calc(90vh - 110px) ;
327 white-space: normal;
328}
329#topmenu-quickadd-dropdown .dropdown-menu > .bookmark-body, #topmenu-quickadd-dropdown .dropdown-body,
330#topmenu-bookmark-dropdown .dropdown-menu > .bookmark-body, #topmenu-bookmark-dropdown .dropdown-body {
331 max-height: 60vh ; /* fallback for browsers without support for calc() */
332 max-height: calc(90vh - 200px) ;
333}
334
335
336.dropdown-body::-webkit-scrollbar {
337 width: 8px;
338 }
339.dropdown-body::-webkit-scrollbar-thumb {
340 -webkit-border-radius: 0;
341 border-radius: 0;
342 /* background: rgb(<?php echo $colorbackhmenu1 ?>); */
343 background: #aaa;
344}
345.dropdown-body::-webkit-scrollbar-track {
346 -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
347 -webkit-border-radius: 0;
348 border-radius: 0;
349}
350
351#topmenu-tool,
352#topmenu-login-dropdown,
353#topmenu-quickadd-dropdown,
354#topmenu-bookmark-dropdown,
355#topmenu-global-search-dropdown,
356#topmenu-ai-dropdown,
357#topmenu-uploadfile-dropdown {
358 padding: 0 5px 0 5px;
359}
360#topmenu-login-dropdown a:hover{
361 text-decoration: none;
362}
363
364#topmenuloginmoreinfo-btn, #topmenulogincompanyinfo-btn {
365 display: block;
366 text-align: start;
367 color:#666;
368 cursor: pointer;
369}
370
371#topmenuloginmoreinfo, #topmenulogincompanyinfo {
372 display: none;
373 clear: both;
374 font-size: 0.95em;
375}
376
377a.dropdown-item {
378 text-align: start;
379}
380.dropdown-item.bookmark-item {
381 padding-top: 10px;
382 padding-bottom: 10px;
383 padding-left: 14px;
384 padding-right: 14px;
385}
386.dropdown-item.bookmark-item:before {
387 width: 20px;
388 padding-left: 2px;
389}
390
391.button-top-menu-dropdown {
392 display: inline-block;
393 padding: 6px 12px;
394 margin-bottom: 0;
395 font-size: 14px;
396 font-weight: 400;
397 line-height: 1.42857143;
398 text-align: center;
399 white-space: nowrap;
400 vertical-align: middle;
401 -ms-touch-action: manipulation;
402 touch-action: manipulation;
403 cursor: pointer;
404 -webkit-user-select: none;
405 -moz-user-select: none;
406 -ms-user-select: none;
407 user-select: none;
408 background-image: none;
409 border: 1px solid transparent;
410 border-radius: <?php echo $borderradius; ?>px;
411}
412
413.user-footer .button-top-menu-dropdown {
414 color: #666666;
415 box-shadow: none;
416 border-width: 1px;
417 background-color: #f4f4f4;
418 border-color: #ddd;
419}
420
421.dropdown-menu a.top-menu-dropdown-link {
422 color: rgb(<?php print $colortextlink; ?>) !important;
423 box-shadow: none;
424 display: block;
425 margin: 5px 0px;
426}
427
428.dropdown-item {
429 display: block !important;
430 box-sizing: border-box;
431 width: 100%;
432 padding: .3em 1.5em .4em 1em;
433 clear: both;
434 font-weight: 400;
435 color: #212529 !important;
436 text-align: inherit;
437 background-color: transparent;
438 border: 0;
439 box-shadow: none;
440}
441
442.dropdown-item::before {
443 /* font part */
444 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
445 font-weight: 900;
446 font-style: normal;
447 font-variant: normal;
448 text-rendering: auto;
449 -webkit-font-smoothing: antialiased;
450 text-align:center;
451 text-decoration:none;
452 margin-<?php echo $right; ?>: 5px;
453 display: inline-block;
454 content: "\f0da";
455 color: rgba(0,0,0,0.3);
456}
457.multicompany-item::before {
458 content: none !important;
459}
460
461.dropdown-item.bookmark-item-external::before {
462 content: "\f35d";
463}
464
465.dropdown-item.active, .dropdown-item:hover, .dropdown-item:hover::before, .dropdown-item:hover span::before, .dropdown-item:focus, .dropdown-item:focus span::before {
466 color: #<?php echo $colortextbackhmenu; ?> !important;
467 text-decoration: none;
468 background: rgb(<?php echo $colorbackhmenu1 ?>);
469}
470
471
472/*
473 * SELECT FIELDS
474 */
475
476li.liinputsearch {
477 position: sticky;
478 display: block;
479 top: 0;
480 z-index: 1;
481}
482
483
484/*
485 * SEARCH
486 */
487
488#topmenu-global-search-dropdown .dropdown-menu {
489 width: 310px !important;
490}
491
492.dropdown-search-input {
493 width: 100%;
494 padding: 10px 35px 10px 20px;
495
496 background-color: transparent;
497 font-size: 14px;
498 line-height: 16px;
499 box-sizing: border-box;
500
501
502 color: #575756;
503 background-color: transparent;
504 background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
505 background-repeat: no-repeat;
506 background-size: 16px 16px;
507 background-position: 95% center;
508 border-radius: <?php print $borderradius; ?>px;
509
510 border: 1px solid #c4c4c2 !important;
511 transition: all 250ms ease-in-out;
512 backface-visibility: hidden;
513 transform-style: preserve-3d;
514
515}
516
517
518
519/*
520 * QUICK ADD
521 */
522
523#topmenu-quickadd-dropdown .dropdown-menu {
524 width: 310px;
525 color: #444;
526}
527
528.quickadd-body.dropdown-body {
529 padding: unset;
530 padding-top: 10px;
531 padding-bottom: 10px;
532}
533
534.quickadd-item {
535 font-size: 1.1em;
536 padding-top: 8px;
537 padding-bottom: 8px;
538}
539
540.quickadd-item:before {
541 content: none;
542}
543
544.quickadd-header {
545 color: #444 !important;
546}
547
548div.quickadd {
549 display: -ms-flexbox;
550 display: -webkit-flex;
551 display: flex;
552 -webkit-flex-direction: row;
553 -ms-flex-direction: row;
554 flex-direction: row;
555 -webkit-flex-wrap: wrap;
556 -ms-flex-wrap: wrap;
557 flex-wrap: wrap;
558 -webkit-justify-content: center;
559 -ms-flex-pack: center;
560 justify-content: center;
561 -webkit-align-content: center;
562 -ms-flex-line-pack: center;
563 align-content: center;
564 -webkit-align-items: flex-start;
565 -ms-flex-align: start;
566 align-items: flex-start;
567}
568
569div.quickadd a {
570 color: #444;
571}
572
573div.quickadd a:hover, div.quickadd a:active {
574 color: #000000;
575}
576
577div.quickaddblock {
578 width: 95px;
579 height: 80px;
580}
581
582div.quickaddblock:hover,
583div.quickaddblock:active,
584div.quickaddblock:focus {
585 background: <?php print $colorbacklinepair1; ?>;
586}
587
588
589/* for the dropdown on action buttons */
590.dropdown-holder {
591 position: relative;
592 display: inline-block;
593}
594
595.dropdown-content {
596 display: none;
597 position: absolute;
598 z-index: 5;
599 width: 300px;
600 right:0;
601 bottom: 0;
602 transform: translateY(100%);
603
604 background: #fff;
605 border: 1px solid #bbb;
606 text-align: <?php echo $left; ?>;
607 box-shadow: 5px 5px 0px rgba(0,0,0,0.1);
608}
609
610/* dropdown --up variant */
611.dropdown-holder.--up .dropdown-content{
612 bottom: auto;
613 top: 0;
614 transform: translateY(-100%);
615}
616
617/* dropdown --left variant */
618.dropdown-holder.--left .dropdown-content{
619 right: auto;
620 left: 12px;
621}
622
623
624.dropdown-content a {
625 margin-right: auto !important;
626 margin-left: auto !important;
627}
628.dropdown-content .butAction {
629 background: none;
630 color: #000 !important;
631}
632.dropdown-content a:is(.butAction,.butActionDelete,.butActionRefused) {
633 display: flex;
634 border-radius: 0;
635}
636.dropdown-content .butAction:hover {
637 box-shadow: none;
638 background-color: var(--butactionbg);
639 color: var(--textbutaction) !important;
640 text-decoration: none;
641}
642
643.dropdown-content .butActionDelete{
644 background-color: transparent !important;
645 color: #633 !important;
646}
647.dropdown-content .butActionDelete:hover {
648 box-shadow: none;
649 background-color: var(--butactiondeletebg) !important;
650 color: #633 !important;
651 text-decoration: none;
652}
653
654.dropdown-content .butActionRefused {
655 margin-left: 0;
656 margin-right: 0;
657 border: none;
658}
659
660.dropdown-holder.open .dropdown-content {
661 display: block;
662}
663
664
666.dropdown-holder.open .dropdown-content::before {
667 --triangleBorderSize : 5px;
668 position: absolute;
669 content: "";
670 top: calc(var(--triangleBorderSize) * -1);
671 right: 12px;
672 width: 0px;
673 height: 0px;
674 border-style: solid;
675 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
676 border-color: transparent transparent #ffff transparent;
677 transform: rotate(0deg);
678}
679
680/* dropdown --up variant*/
681.dropdown-holder.--up.open .dropdown-content::before{
682 top: auto;
683 bottom: calc(var(--triangleBorderSize) * -1);
684 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
685 transform: rotate(180deg);
686}
687
688/* dropdown --left variant*/
689.dropdown-holder.--left.open .dropdown-content::before{
690 right: auto;
691 left: 12px;
692}
693
694
695/* smartphone */
696@media only screen and (max-width: 767px)
697{
698 div.login_block {
699 top: unset;
700 border-right: 1px solid rgba(0, 0, 0, 0.3)
701 }
702
703 .userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto {
704 width: 16px;
705 height: 16px;
706 }
707 div#topmenu-login-dropdown {
708 height: 20px;
709 line-height: 20px;
710 }
711
712 #topmenu-login-dropdown .dropdown-menu {
713 min-width: 220px;
714 max-width: 360px;
715 }
716
717 div.login_block a .atoploginusername {
718 color: var(--colortextbackvmenu);
719 }
720
721 .dropdown-menu:not(.ai_dropdown) {
722 border: none;
723 box-shadow: none;
724 }
725
726 #topmenu-global-search-dropdown a.login-dropdown-a,
727 #topmenu-quickadd-dropdown a.login-dropdown-a,
728 #topmenu-bookmark-dropdown a.login-dropdown-a,
729 #topmenu-login-dropdown a.login-dropdown-a,
730 #topmenu-uploadfile-dropdown a.login-dropdown-a {
731 color: var(--colortextbackvmenu);
732 }
733
734 #topmenu-global-search-dropdown .dropdown-menu,
735 #topmenu-quickadd-dropdown .dropdown-menu,
736 #topmenu-bookmark-dropdown .dropdown-menu,
737 #topmenu-login-dropdown .dropdown-menu,
738 #topmenu-uploadfile-dropdown .dropdown-menu {
739 width: 100%;
740 min-width: unset;
741 }
742
743 div.login_block_tools > div {
744 position: unset;
745 }
746 div#topmenu-global-search-dropdown,
747 div#topmenu-quickadd-dropdown,
748 div#topmenu-bookmark-dropdown,
749 div#topmenu-uploadfile-dropdown,
750 div#topmenu-login-dropdown {
751 position: unset;
752 }
753
754 div#topmenu-global-search-dropdown,
755 div#topmenu-quickadd-dropdown,
756 div#topmenu-bookmark-dropdown,
757 div#topmenu-uploadfile-dropdown {
758 line-height: unset;
759 }
760
761 div.login_block_other {
762 padding-top: 2px;
763 }
764
765 ul.tmenu {
766 margin-right: 2px;
767 }
768}
769
770@media only screen and (max-width: 320px)
771{
772 .dropdown dd ul {
773 max-width: 270px; /* must always be 50 slower than width */
774 }
775}
776@media only screen and (max-width: 300px)
777{
778 .dropdown dd ul {
779 max-width: 250px;
780 }
781}
782@media only screen and (max-width: 280px)
783{
784 .dropdown dd ul {
785 max-width: 230px;
786 }
787}
788
789
790.dropdown-search-input::placeholder {
791 color: color(#575756);
792 letter-spacing: 1.5px;
793}
794
795.hidden-search-result{
796 display: none !important;
797}
print $object position
Definition edit.php:206
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:134