btn.inc.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <?php
  2. if (!defined('ISLOADEDBYSTEELSHEET')) {
  3. die('Must be call by steelsheet');
  4. } ?>
  5. /* <style type="text/css" > */
  6. :root {
  7. --btncolortext: rgb(<?php print $colortextlink; ?>);
  8. --btncolorbg: #fbfbfb;
  9. --btncolorborderhover: none;
  10. --btncolorborder: #FFF;
  11. --butactiondeletebg: rgb(234,228,225);
  12. --butactionbg: rgb(<?php print $butactionbg; ?>);
  13. --textbutaction: rgb(<?php print $textbutaction; ?>);
  14. }
  15. <?php
  16. if (getDolGlobalString('THEME_DARKMODEENABLED')) {
  17. print "/* For dark mode */\n";
  18. if ($conf->global->THEME_DARKMODEENABLED != 2) {
  19. print "@media (prefers-color-scheme: dark) {"; // To test, click on the 3 dots menu, then Other options then Display then emulate prefer-color-schemes
  20. } else {
  21. print "@media not print {";
  22. }
  23. print "
  24. :root {
  25. --btncolortext: ;
  26. --btncolorbg: rgb(26,27,27);
  27. --btncolorborderhover: #ffffff;
  28. --btncolorborder: #2b2c2e;
  29. --butactiondeletebg: rgb(252,84,91);
  30. --butactionbg: rgb(173,140,79);
  31. --textbutaction: rgb(255,255,255);
  32. }\n";
  33. print "}";
  34. }
  35. ?>
  36. /* ============================================================================== */
  37. /* Buttons for actions */
  38. /* ============================================================================== */
  39. /*div.divButAction {
  40. margin-bottom: 1.4em;
  41. }*/
  42. div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
  43. div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
  44. div.tabsAction > div.divButAction > span.butAction,
  45. div.tabsAction > div.divButAction > span.butActionDelete,
  46. div.tabsAction > div.divButAction > span.butActionRefused,
  47. div.tabsAction > div.divButAction > a.butAction,
  48. div.tabsAction > div.divButAction > a.butActionDelete,
  49. div.tabsAction > div.divButAction > a.butActionRefused {
  50. margin-bottom: 1.4em !important;
  51. margin-right: 0px !important;
  52. }
  53. div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
  54. margin-bottom: 0 !important;
  55. }
  56. span.butAction, span.butActionDelete {
  57. cursor: pointer;
  58. }
  59. .paginationafterarrows .butAction {
  60. font-size: 0.9em;
  61. }
  62. .butAction {
  63. background: var(--butactionbg);
  64. color: var(--textbutaction) !important;
  65. /* background: rgb(230, 232, 239); */
  66. }
  67. .butActionRefused, .butAction, .butActionDelete {
  68. border-radius: 3px;
  69. }
  70. :not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child {
  71. margin-<?php echo $right; ?>: 0px !important;
  72. }
  73. .butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
  74. text-decoration: none;
  75. text-transform: uppercase;
  76. font-weight: bold;
  77. margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '1'); ?>em;
  78. padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
  79. display: inline-block;
  80. text-align: center;
  81. cursor: pointer;
  82. color: #444;
  83. border: 1px solid transparent; /* So for buttonRefused with a border, it will not have any flash effect */
  84. /* border: 1px solid #aaa; */
  85. /* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
  86. /*border-top-right-radius: 0 !important;
  87. border-bottom-right-radius: 0 !important;
  88. border-top-left-radius: 0 !important;
  89. border-bottom-left-radius: 0 !important;*/
  90. }
  91. .butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
  92. text-decoration: none;
  93. text-transform: uppercase;
  94. font-weight: normal;
  95. margin: 0em 0.3em 0 0.3em !important;
  96. padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
  97. font-family: <?php print $fontlist ?>;
  98. display: inline-block;
  99. /* text-align: center; New button are on right of screen */
  100. cursor: pointer;
  101. }
  102. .tableforfieldcreate a.butActionNew>span.fa-plus-circle, .tableforfieldcreate a.butActionNew>span.fa-plus-circle:hover,
  103. .tableforfieldedit a.butActionNew>span.fa-plus-circle, .tableforfieldedit a.butActionNew>span.fa-plus-circle:hover,
  104. span.butActionNew>span.fa-plus-circle, span.butActionNew>span.fa-plus-circle:hover,
  105. a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover,
  106. span.butActionNewRefused>span.fa-plus-circle, span.butActionNewRefused>span.fa-plus-circle:hover,
  107. a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover,
  108. span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover,
  109. a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover,
  110. span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover
  111. {
  112. font-size: 1em;
  113. padding-left: 0px;
  114. }
  115. a.butActionNew>span.fa, a.butActionNew>span.fa:hover,
  116. span.butActionNew>span.fa, span.butActionNew>span.fa:hover,
  117. a.butActionNewRefused>span.fa, a.butActionNewRefused>span.fa:hover,
  118. span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
  119. {
  120. padding-<?php echo $left; ?>: 6px;
  121. font-size: 1.5em;
  122. border: none;
  123. box-shadow: none; webkit-box-shadow: none;
  124. }
  125. .butAction:hover {
  126. -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  127. box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  128. }
  129. .butActionNew:hover {
  130. text-decoration: underline;
  131. box-shadow: unset !important;
  132. }
  133. .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
  134. background: var(--butactiondeletebg) !important;
  135. /* border: 1px solid #633; */
  136. color: #633 !important;
  137. }
  138. .butActionDelete:hover {
  139. -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  140. box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
  141. }
  142. .butActionRefused {
  143. text-decoration: none !important;
  144. text-transform: uppercase;
  145. font-weight: bold !important;
  146. white-space: nowrap !important;
  147. cursor: not-allowed !important;
  148. font-family: <?php print $fontlist ?> !important;
  149. display: inline-block;
  150. text-align: center;
  151. cursor: pointer;
  152. box-sizing: border-box;
  153. -moz-box-sizing: border-box;
  154. -webkit-box-sizing: border-box;
  155. color: #999 !important;
  156. border: 1px solid #ccc;
  157. }
  158. .butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
  159. text-decoration: none !important;
  160. text-transform: uppercase;
  161. font-weight: normal !important;
  162. white-space: nowrap !important;
  163. cursor: not-allowed !important;
  164. margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
  165. padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
  166. font-family: <?php print $fontlist ?> !important;
  167. display: inline-block;
  168. /* text-align: center; New button are on right of screen */
  169. cursor: pointer;
  170. color: #999 !important;
  171. padding-top: 0.2em;
  172. box-shadow: none !important;
  173. -webkit-box-shadow: none !important;
  174. }
  175. .butActionTransparent {
  176. color: #222 ! important;
  177. background-color: transparent ! important;
  178. }
  179. /*
  180. TITLE BUTTON
  181. */
  182. .btnTitle, a.btnTitle {
  183. display: inline-block;
  184. padding: 4px 4px 4px 4px;
  185. font-weight: 400;
  186. /* line-height: 1; */
  187. text-align: center;
  188. white-space: nowrap;
  189. vertical-align: middle;
  190. -ms-touch-action: manipulation;
  191. touch-action: manipulation;
  192. cursor: pointer;
  193. -webkit-user-select: none;
  194. -moz-user-select: none;
  195. -ms-user-select: none;
  196. user-select: none;
  197. box-shadow: var(--btncolorbg);
  198. text-decoration: none;
  199. position: relative;
  200. /* margin: 0 0 0 8px; */
  201. min-width: 72px;
  202. text-align: center;
  203. color: var(--btncolortext);
  204. border: none;
  205. font-size: 12px;
  206. font-weight: 300;
  207. background-color: var(--btncolorbg);
  208. border: 1px solid var(--btncolorborder);
  209. }
  210. a.btnTitle.btnTitleSelected {
  211. border: 1px solid #ccc;
  212. border-radius: 3px;
  213. }
  214. .btnTitle > .btnTitle-icon{
  215. }
  216. .btnTitle > .btnTitle-label{
  217. color: #666666;
  218. }
  219. .btnTitle:hover, a.btnTitle:hover {
  220. border: 1px solid #bbb;
  221. border-radius: 3px;
  222. position: relative;
  223. text-align: center;
  224. font-size: 12px;
  225. text-decoration: none;
  226. box-shadow: none;
  227. }
  228. /* The buttonplus isgrowing on hover (dont know why). This is to avoid to have the cellegrowing too */
  229. .btnTitlePlus:hover {
  230. max-width: 24px;
  231. max-height: 40px;
  232. }
  233. .btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
  234. color: #8a8a8a;
  235. cursor: not-allowed;
  236. background-color: #fbfbfb;
  237. background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
  238. }
  239. .btnTitle:hover .btnTitle-label{
  240. color: var(--btncolorborderhover);
  241. }
  242. .btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
  243. color: #8a8a8a;
  244. }
  245. .btnTitle>.fa {
  246. font-size: 2em;
  247. display: block;
  248. }
  249. div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrows a.btnTitle {
  250. margin-<?php echo $left; ?>: 10px;
  251. }
  252. .button-title-separator{
  253. display: inline-block;
  254. clear: both;
  255. width: 20px;
  256. }
  257. .imgforviewmode {
  258. color: #aaa;
  259. }
  260. /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
  261. @media only screen and (max-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC2') ? round($nbtopmenuentries * 69, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */
  262. {
  263. .butAction, .butActionRefused, .butActionDelete {
  264. font-size: 0.95em;
  265. }
  266. .btnTitle, a.btnTitle {
  267. display: inline-block;
  268. padding: 4px 4px 4px 4px;
  269. min-width: unset;
  270. }
  271. }
  272. /* rule to reduce top menu - 3rd reduction: The menu for user is on left */
  273. @media only screen and (max-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC3') ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
  274. {
  275. .butAction, .butActionRefused, .butActionDelete {
  276. font-size: 0.9em;
  277. }
  278. }
  279. /* smartphone */
  280. @media only screen and (max-width: 767px)
  281. {
  282. .butAction, .butActionRefused, .butActionDelete {
  283. font-size: 0.85em;
  284. }
  285. }
  286. <?php if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin)) { ?>
  287. .butActionRefused, .butActionNewRefused, .btnTitle.refused {
  288. display: none !important;
  289. }
  290. <?php } ?>
  291. /*
  292. * BTN LINK
  293. */
  294. .btn-link{
  295. margin-right: 5px;
  296. border: 1px solid #ddd;
  297. color: #333;
  298. padding: 5px 10px;
  299. border-radius:1em;
  300. text-decoration: none !important;
  301. }
  302. .btn-link:hover{
  303. background-color: #ddd;
  304. border: 1px solid #ddd;
  305. }