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