dolibarr 24.0.0-beta
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-quickadd-dropdown,
336#topmenu-bookmark-dropdown,
337#topmenu-uploadfile-dropdown,
338#topmenu-login-dropdown {
339 padding: 0 5px 0 5px;
340}
341#topmenu-login-dropdown a:hover{
342 text-decoration: none;
343}
344
345#topmenuloginmoreinfo-btn, #topmenulogincompanyinfo-btn {
346 display: block;
347 text-align: start;
348 color:#666;
349 cursor: pointer;
350}
351
352#topmenuloginmoreinfo, #topmenulogincompanyinfo {
353 display: none;
354 clear: both;
355 font-size: 0.95em;
356}
357
358a.dropdown-item {
359 text-align: start;
360}
361
362.button-top-menu-dropdown {
363 display: inline-block;
364 padding: 6px 12px;
365 margin-bottom: 0;
366 font-size: 14px;
367 font-weight: 400;
368 line-height: 1.42857143;
369 text-align: center;
370 white-space: nowrap;
371 vertical-align: middle;
372 -ms-touch-action: manipulation;
373 touch-action: manipulation;
374 cursor: pointer;
375 -webkit-user-select: none;
376 -moz-user-select: none;
377 -ms-user-select: none;
378 user-select: none;
379 background-image: none;
380 border: 1px solid transparent;
381 border-radius: 3px;
382}
383
384.user-footer .button-top-menu-dropdown {
385 color: #666666;
386 box-shadow: none;
387 border-width: 1px;
388 background-color: #f4f4f4;
389 border-color: #ddd;
390}
391
392.dropdown-menu a.top-menu-dropdown-link {
393 color: rgb(<?php print $colortextlink; ?>) !important;
394 box-shadow: none;
395 display: block;
396 margin: 5px 0px;
397}
398
399.dropdown-item {
400 display: block !important;
401 box-sizing: border-box;
402 width: 100%;
403 padding: .5em 1.5em .5em 1em;
404 clear: both;
405 font-weight: 400;
406 color: #212529 !important;
407 text-align: inherit;
408 background-color: transparent;
409 border: 0;
410 box-shadow: none;
411}
412.dropdown-item.bookmark-item {
413 padding-left: 0;
414 padding-right: 0;
415}
416.dropdown-item.bookmark-item:before {
417 width: 20px;
418 padding-left: 2px;
419}
420
421
422.dropdown-item::before {
423 /* font part */
424 font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
425 font-weight: 900;
426 font-style: normal;
427 font-variant: normal;
428 text-rendering: auto;
429 -webkit-font-smoothing: antialiased;
430 text-align:center;
431 text-decoration:none;
432 margin-<?php echo $right; ?>: 5px;
433 display: inline-block;
434 content: "\f0da";
435 /* color: rgba(0,0,0,0.3); */
436}
437.multicompany-item::before {
438 content: none !important;
439}
440
441.dropdown-item.bookmark-item-external::before {
442 content: "\f35d";
443}
444
445.dropdown-item.active, .dropdown-item:hover, .dropdown-item:hover span::before, .dropdown-item:focus, .dropdown-item:focus span::before {
446 color: #<?php echo $colortextbackhmenu; ?> !important;
447 text-decoration: none;
448 background: rgb(<?php echo $colorbackhmenu1 ?>);
449}
450
451
452/*
453 * SELECT FIELDS
454 */
455
456li.liinputsearch {
457 position: sticky;
458 display: block;
459 top: 0;
460 background: var(--colorbackbody);
461 z-index: 1;
462}
463
464
465
466/*
467 * QUICK ADD
468 */
469
470#topmenu-quickadd-dropdown .dropdown-menu {
471 width: <?php echo $WIDTHMENUDROPDOWN; ?>px;
472 color: #444;
473}
474
475.quickadd-body.dropdown-body {
476 padding: unset;
477 padding-top: 10px;
478 padding-bottom: 10px;
479}
480
481.quickadd-item {
482 font-size: 1.1em;
483}
484
485.quickadd-item:before {
486 content: none;
487}
488
489.quickadd-header {
490 color: #444 !important;
491}
492
493div.quickadd {
494 display: -ms-flexbox;
495 display: -webkit-flex;
496 display: flex;
497 -webkit-flex-direction: row;
498 -ms-flex-direction: row;
499 flex-direction: row;
500 -webkit-flex-wrap: wrap;
501 -ms-flex-wrap: wrap;
502 flex-wrap: wrap;
503 -webkit-justify-content: center;
504 -ms-flex-pack: center;
505 justify-content: center;
506 -webkit-align-content: center;
507 -ms-flex-line-pack: center;
508 align-content: center;
509 -webkit-align-items: flex-start;
510 -ms-flex-align: start;
511 align-items: flex-start;
512}
513
514div.quickadd a {
515 color: #444;
516}
517
518div.quickadd a:hover, div.quickadd a:active {
519 color: #000000;
520}
521
522div.quickaddblock {
523 width: 95px;
524 height: 80px;
525}
526
527div.quickaddblock:hover,
528div.quickaddblock:active,
529div.quickaddblock:focus {
530 background: <?php print "#".colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?>;
531}
532
533
534/* for the dropdown on action buttons */
535.dropdown-holder {
536 position: relative;
537 display: inline-block;
538}
539
540.dropdown-content {
541 display: none;
542 position: absolute;
543 z-index: 5;
544 width: 300px;
545 right:0; /* will be set with js */
546 bottom: 0;
547 transform: translateY(100%);
548
549 background: #fff;
550 border: 1px solid #bbb;
551 text-align: <?php echo $left; ?>;
552 box-shadow: 5px 5px 0px rgba(0,0,0,0.1);
553}
554
555/* dropdown --up variant */
556.dropdown-holder.--up .dropdown-content{
557 bottom: auto;
558 top: 0;
559 transform: translateY(-100%);
560}
561
562/* dropdown --left variant */
563.dropdown-holder.--left .dropdown-content{
564 right: auto;
565 left: 12px;
566}
567
568
569.dropdown-content a {
570 margin-right: auto !important;
571 margin-left: auto !important;
572}
573.dropdown-content .butAction {
574 background: none;
575 color: #333 !important;
576}
577.dropdown-content a:is(.butAction,.butActionDelete,.butActionRefused) {
578 display: flex;
579 border-radius: 0;
580}
581
582.dropdown-content .butAction:hover {
583 box-shadow: none;
584 background-color: var(--butactionbg);
585 color: var(--textbutaction) !important;
586 text-decoration: none;
587}
588
589.dropdown-content .butActionDelete{
590 background-color: transparent !important;
591 color: #633 !important;
592}
593.dropdown-content .butActionDelete:hover {
594 box-shadow: none;
595 background-color: var(--butactiondeletebg) !important;
596 color: #633 !important;
597 text-decoration: none;
598}
599
600.dropdown-content .butActionRefused {
601 margin-left: 0;
602 margin-right: 0;
603 border: none;
604}
605
606.dropdown-holder.open .dropdown-content {
607 display: block;
608}
609
611.dropdown-holder.open .dropdown-content::before {
612 --triangleBorderSize : 5px;
613 position: absolute;
614 content: "";
615 top: calc(var(--triangleBorderSize) * -1);
616 right: 12px;
617 width: 0px;
618 height: 0px;
619 border-style: solid;
620 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
621 border-color: transparent transparent #ffff transparent;
622 transform: rotate(0deg);
623}
624
625/* dropdown --up variant*/
626.dropdown-holder.--up.open .dropdown-content::before{
627 top: auto;
628 bottom: calc(var(--triangleBorderSize) * -1);
629 border-width: 0 var(--triangleBorderSize) var(--triangleBorderSize) var(--triangleBorderSize);
630 transform: rotate(180deg);
631}
632
633/* dropdown --left variant*/
634.dropdown-holder.--left.open .dropdown-content::before{
635 right: auto;
636 left: 12px;
637}
638
639.dropdown-search-input {
640 border-radius: <?php print $borderradius; ?>px;
641}
642
643/* smartphone */
644@media only screen and (max-width: 767px)
645{
646 .dropdown-search-input,.search-tool-input {
647 width: 100%;
648 }
649
650 .tmenu .dropdown-menu, .login_block .dropdown-menu, .topnav .dropdown-menu {
651 margin-left: 8px;
652 right: 0;
653 }
654
655 #topmenu-bookmark-dropdown .dropdown-menu, #topmenu-quickadd-dropdown .dropdown-menu {
656 min-width: 220px;
657 max-width: 360px;
658 }
659
660 .side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu {
661 width: 300px;
662 }
663 .dropdown-menu:not(.ai_dropdown) {
664 border: none;
665 box-shadow: none;
666 border-bottom: 1px solid #888;
667 }
668
669}
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