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