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