diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index a8393c3320..65faacf54e 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -498,6 +498,9 @@ header{ .actions a:hover{ text-decoration: none; } +.actions div.text-right { + text-align: left; +} .actions img{ padding: 3px; border: 1px solid #dcdcdc; @@ -6586,7 +6589,13 @@ input.form-control[type="color"] { /* Small devices (tablets, 768px and up) */ @media (min-width: 768px) { - + .actions div.text-right{ + text-align: right; + } + .actions .row .text-right a{ + margin-left: 10px; + margin-right: 0; + } } /* Medium devices (desktops, 992px and up) */ diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 8bf7d55a4a..c02101b5a4 100755 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -2389,39 +2389,32 @@ class Display } /** - * @param int $id + * @param string $id * @param array $content - * @param int $col - * @param bool|true $right + * @param array $cols Optional. Columns width * @return string */ - public static function toolbarAction($id, $content = array(), $col = 2, $right = true) + public static function toolbarAction($id, $content, $cols = [6, 6]) { - $columns = 12/$col; - $html = ''; - $html .= '
'; + $col = count($content); + + $html = '
'; $html .= '
'; - if ($col > 4) { - $html = ''; - } else { - for ($i = 0; $i < $col; $i++) { - $html .= '
'; - if ($col == 2 && $i == 1) { - if ($right === true) { - $html .= '
'; - $html .= (isset($content[$i]) ? $content[$i] : ''); - $html .= '
'; - } else { - $html .= $content[$i]; - } - } else { - $html .= $content[$i]; + + for ($i = 0; $i < $col; $i++) { + $class = 'col-sm-'.$cols[$i]; + + if ($col > 1) { + if ($i > 0 && $i < count($content) -1) { + $class .= ' text-center'; + } elseif ($i === count($content) - 1) { + $class .= ' text-right'; } - $html .= '
'; } + + $html .= '
'.$content[$i].'
'; } + $html .= '
'; $html .= '
';