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