dolibarr 22.0.5
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: 50px;
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
306.dropdown-menu > .user-body, .dropdown-body{
307 padding: 15px;
308 border-bottom: 1px solid #f4f4f4;
309 border-top: 1px solid #f0f0f0;
310 white-space: normal;
311}
312
313.dropdown-menu > .bookmark-body, .dropdown-body{
314 padding: 10px 0;
315 overflow-y: auto;
316 max-height: 60vh ; /* fallback for browsers without support for calc() */
317 max-height: calc(90vh - 110px) ;
318 white-space: normal;
319}
320#topmenu-quickadd-dropdown .dropdown-menu > .bookmark-body, #topmenu-quickadd-dropdown .dropdown-body,
321#topmenu-bookmark-dropdown .dropdown-menu > .bookmark-body, #topmenu-bookmark-dropdown .dropdown-body {
322 max-height: 60vh ; /* fallback for browsers without support for calc() */
323 max-height: calc(90vh - 200px) ;
324}
325
326
327.dropdown-body::-webkit-scrollbar {
328 width: 8px;
329 }
330.dropdown-body::-webkit-scrollbar-thumb {
331 -webkit-border-radius: 0;
332 border-radius: 0;
333 /* background: rgb(<?php echo $colorbackhmenu1 ?>); */
334 background: #aaa;
335}
336.dropdown-body::-webkit-scrollbar-track {
337 -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
338 -webkit-border-radius: 0;
339 border-radius: 0;
340}
341
342
343#topmenu-login-dropdown,
344#topmenu-quickadd-dropdown,
345#topmenu-bookmark-dropdown,
346#topmenu-global-search-dropdown,
347#topmenu-uploadfile-dropdown {
348 padding: 0 5px 0 5px;
349}
350#topmenu-login-dropdown a:hover{
351 text-decoration: none;
352}
353
354#topmenuloginmoreinfo-btn, #topmenulogincompanyinfo-btn {
355 display: block;
356 text-align: start;
357 color:#666;
358 cursor: pointer;
359}
360
361#topmenuloginmoreinfo, #topmenulogincompanyinfo {
362 display: none;
363 clear: both;
364 font-size: 0.95em;
365}
366
367a.dropdown-item {
368 text-align: start;
369}
370.dropdown-item.bookmark-item {
371 padding-left: 14px;
372 padding-right: 14px;
373}
374.dropdown-item.bookmark-item:before {
375 width: 20px;
376 padding-left: 2px;
377}
378
379.button-top-menu-dropdown {
380 display: inline-block;
381 padding: 6px 12px;
382 margin-bottom: 0;
383 font-size: 14px;
384 font-weight: 400;
385 line-height: 1.42857143;
386 text-align: center;
387 white-space: nowrap;
388 vertical-align: middle;
389 -ms-touch-action: manipulation;
390 touch-action: manipulation;
391 cursor: pointer;
392 -webkit-user-select: none;
393 -moz-user-select: none;
394 -ms-user-select: none;
395 user-select: none;
396 background-image: none;
397 border: 1px solid transparent;
398 border-radius: <?php echo $borderradius; ?>px;
399}
400
401.user-footer .button-top-menu-dropdown {
402 color: #666666;
403 box-shadow: none;
404 border-width: 1px;
405 background-color: #f4f4f4;
406 border-color: #ddd;
407}
408
409.dropdown-menu a.top-menu-dropdown-link {
410 color: rgb(<?php print $colortextlink; ?>) !important;
411 box-shadow: none;
412 display: block;
413 margin: 5px 0px;
414}
415
416.dropdown-item {
417 display: block !important;
418 box-sizing: border-box;
419 width: 100%;
420 padding: .3em 1.5em .4em 1em;
421 clear: both;
422 font-weight: 400;
423 color: #212529 !important;
424 text-align: inherit;
425 background-color: transparent;
426 border: 0;
427 box-shadow: none;
428}
429
430.dropdown-item::before {
431 /* font part */
432 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
433 font-weight: 900;
434 font-style: normal;
435 font-variant: normal;
436 text-rendering: auto;
437 -webkit-font-smoothing: antialiased;
438 text-align:center;
439 text-decoration:none;
440 margin-<?php echo $right; ?>: 5px;
441 display: inline-block;
442 content: "\f0da";
443 color: rgba(0,0,0,0.3);
444}
445.multicompany-item::before {
446 content: none !important;
447}
448
449.dropdown-item.bookmark-item-external::before {
450 content: "\f35d";
451}
452
453.dropdown-item.active, .dropdown-item:hover, .dropdown-item:hover::before, .dropdown-item:hover span::before, .dropdown-item:focus, .dropdown-item:focus span::before {
454 color: #<?php echo $colortextbackhmenu; ?> !important;
455 text-decoration: none;
456 background: rgb(<?php echo $colorbackhmenu1 ?>);
457}
458
459
460/*
461 * SELECT FIELDS
462 */
463
464li.liinputsearch {
465 position: sticky;
466 display: block;
467 top: 0;
468 background: var(--colorbackbody);
469 z-index: 1;
470}
471
472
473/*
474 * SEARCH
475 */
476
477#topmenu-global-search-dropdown .dropdown-menu {
478 width: 310px !important;
479}
480
481.dropdown-search-input {
482 width: 100%;
483 padding: 10px 35px 10px 20px;
484
485 background-color: transparent;
486 font-size: 14px;
487 line-height: 16px;
488 box-sizing: border-box;
489
490
491 color: #575756;
492 background-color: transparent;
493 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");
494 background-repeat: no-repeat;
495 background-size: 16px 16px;
496 background-position: 95% center;
497 border-radius: <?php print $borderradius; ?>px;
498
499 border: 1px solid #c4c4c2 !important;
500 transition: all 250ms ease-in-out;
501 backface-visibility: hidden;
502 transform-style: preserve-3d;
503
504}
505
506
507
508/*
509 * QUICK ADD
510 */
511
512#topmenu-quickadd-dropdown .dropdown-menu {
513 width: 310px;
514 color: #444;
515}
516
517.quickadd-body.dropdown-body {
518 padding: unset;
519 padding-top: 10px;
520 padding-bottom: 10px;
521}
522
523.quickadd-item {
524 font-size: 1.1em;
525 padding-top: 8px;
526 padding-bottom: 8px;
527}
528
529.quickadd-item:before {
530 content: none;
531}
532
533.quickadd-header {
534 color: #444 !important;
535}
536
537div.quickadd {
538 display: -ms-flexbox;
539 display: -webkit-flex;
540 display: flex;
541 -webkit-flex-direction: row;
542 -ms-flex-direction: row;
543 flex-direction: row;
544 -webkit-flex-wrap: wrap;
545 -ms-flex-wrap: wrap;
546 flex-wrap: wrap;
547 -webkit-justify-content: center;
548 -ms-flex-pack: center;
549 justify-content: center;
550 -webkit-align-content: center;
551 -ms-flex-line-pack: center;
552 align-content: center;
553 -webkit-align-items: flex-start;
554 -ms-flex-align: start;
555 align-items: flex-start;
556}
557
558div.quickadd a {
559 color: #444;
560}
561
562div.quickadd a:hover, div.quickadd a:active {
563 color: #000000;
564}
565
566div.quickaddblock {
567 width: 95px;
568 height: 80px;
569}
570
571div.quickaddblock:hover,
572div.quickaddblock:active,
573div.quickaddblock:focus {
574 background: <?php print $colorbacklinepair1; ?>;
575}
576
577
578/* for the dropdown on action buttons */
579.dropdown-holder {
580 position: relative;
581 display: inline-block;
582}
583
584.dropdown-content {
585 display: none;
586 position: absolute;
587 z-index: 5;
588 width: 300px;
589 right:0;
590 bottom: 0;
591 transform: translateY(100%);
592
593 background: #fff;
594 border: 1px solid #bbb;
595 text-align: <?php echo $left; ?>;
596 box-shadow: 5px 5px 0px rgba(0,0,0,0.1);
597}
598
599/* dropdown --up variant */
600.dropdown-holder.--up .dropdown-content{
601 bottom: auto;
602 top: 0;
603 transform: translateY(-100%);
604}
605
606/* dropdown --left variant */
607.dropdown-holder.--left .dropdown-content{
608 right: auto;
609 left: 12px;
610}
611
612
613.dropdown-content a {
614 margin-right: auto !important;
615 margin-left: auto !important;
616}
617.dropdown-content .butAction {
618 background: none;
619 color: #000 !important;
620}
621.dropdown-content a:is(.butAction,.butActionDelete,.butActionRefused) {
622 display: flex;
623 border-radius: 0;
624}
625.dropdown-content .butAction:hover {
626 box-shadow: none;
627 background-color: var(--butactionbg);
628 color: var(--textbutaction) !important;
629 text-decoration: none;
630}
631
632.dropdown-content .butActionDelete{
633 background-color: transparent !important;
634 color: #633 !important;
635}
636.dropdown-content .butActionDelete:hover {
637 box-shadow: none;
638 background-color: var(--butactiondeletebg) !important;
639 color: #633 !important;
640 text-decoration: none;
641}
642
643.dropdown-content .butActionRefused {
644 margin-left: 0;
645 margin-right: 0;
646 border: none;
647}
648
649.dropdown-holder.open .dropdown-content {
650 display: block;
651}
652
653
655.dropdown-holder.open .dropdown-content::before {
656 --triangleBorderSize : 5px;
657 position: absolute;
658 content: "";
659 top: calc(var(--triangleBorderSize) * -1);
660 right: 12px;
661 width: 0px;
662 height: 0px;
663 border-style: solid;
664 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
665 border-color: transparent transparent #ffff transparent;
666 transform: rotate(0deg);
667}
668
669/* dropdown --up variant*/
670.dropdown-holder.--up.open .dropdown-content::before{
671 top: auto;
672 bottom: calc(var(--triangleBorderSize) * -1);
673 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
674 transform: rotate(180deg);
675}
676
677/* dropdown --left variant*/
678.dropdown-holder.--left.open .dropdown-content::before{
679 right: auto;
680 left: 12px;
681}
682
683
684/* smartphone */
685@media only screen and (max-width: 767px)
686{
687 div.login_block {
688 top: unset;
689 border-right: 1px solid rgba(0, 0, 0, 0.3)
690 }
691
692 .userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto {
693 width: 16px;
694 height: 16px;
695 }
696 div#topmenu-login-dropdown {
697 height: 20px;
698 line-height: 20px;
699 }
700
701 #topmenu-login-dropdown .dropdown-menu {
702 min-width: 220px;
703 max-width: 360px;
704 }
705
706 div.login_block a .atoploginusername {
707 color: var(--colortextbackvmenu);
708 }
709
710 .dropdown-menu:not(.ai_dropdown) {
711 border: none;
712 box-shadow: none;
713 }
714
715 #topmenu-global-search-dropdown a.login-dropdown-a,
716 #topmenu-quickadd-dropdown a.login-dropdown-a,
717 #topmenu-bookmark-dropdown a.login-dropdown-a,
718 #topmenu-login-dropdown a.login-dropdown-a,
719 #topmenu-uploadfile-dropdown a.login-dropdown-a {
720 color: var(--colortextbackvmenu);
721 }
722
723 #topmenu-global-search-dropdown .dropdown-menu,
724 #topmenu-quickadd-dropdown .dropdown-menu,
725 #topmenu-bookmark-dropdown .dropdown-menu,
726 #topmenu-login-dropdown .dropdown-menu,
727 #topmenu-uploadfile-dropdown .dropdown-menu {
728 width: 100%;
729 min-width: unset;
730 }
731
732 div.login_block_tools > div {
733 position: unset;
734 }
735 div#topmenu-global-search-dropdown,
736 div#topmenu-quickadd-dropdown,
737 div#topmenu-bookmark-dropdown,
738 div#topmenu-uploadfile-dropdown,
739 div#topmenu-login-dropdown {
740 position: unset;
741 }
742
743 div#topmenu-global-search-dropdown,
744 div#topmenu-quickadd-dropdown,
745 div#topmenu-bookmark-dropdown,
746 div#topmenu-uploadfile-dropdown {
747 line-height: unset;
748 }
749
750 div.login_block_other {
751 padding-top: 2px;
752 }
753
754 ul.tmenu {
755 margin-right: 2px;
756 }
757}
758
759@media only screen and (max-width: 320px)
760{
761 .dropdown dd ul {
762 max-width: 270px; /* must always be 50 slower than width */
763 }
764}
765@media only screen and (max-width: 300px)
766{
767 .dropdown dd ul {
768 max-width: 250px;
769 }
770}
771@media only screen and (max-width: 280px)
772{
773 .dropdown dd ul {
774 max-width: 230px;
775 }
776}
777
778
779.dropdown-search-input::placeholder {
780 color: color(#575756);
781 letter-spacing: 1.5px;
782}
783
784.hidden-search-result{
785 display: none !important;
786}
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.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:162