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