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