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