Use font awesome for sort image

This commit is contained in:
Laurent Destailleur 2018-09-12 21:57:32 +02:00
parent 765d8ec1fe
commit b4264ee0a0
5 changed files with 22 additions and 6 deletions

View File

@ -3153,11 +3153,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
if (empty($srconly) && in_array($pictowithoutext, array(
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
'switch_off', 'switch_on', 'unlink', 'uparrow')
'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow')
)) {
$fakey = $pictowithoutext;
$facolor = '';
$fasize = '';
$facolor = ''; $fasize = '';
$marginleftonlyshort = 0;
if ($pictowithoutext == 'switch_off') {
$fakey = 'fa-toggle-off';
$facolor = '#999';
@ -3210,6 +3210,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-mail-forward';
$facolor = '#555';
}
elseif ($pictowithoutext == '1uparrow') {
$fakey = 'fa-caret-up';
$marginleftonlyshort = 1;
}
elseif ($pictowithoutext == '1downarrow') {
$fakey = 'fa-caret-down';
$marginleftonlyshort = 1;
}
elseif ($pictowithoutext == 'unlink') {
$fakey = 'fa-chain-broken';
$facolor = '#555';
@ -3226,7 +3234,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
$morecss.= ($morecss?' ':'').$reg[1];
}
$enabledisablehtml = '<span class="fa '.$fakey.' marginleftonly valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'"'.($moreatt?' '.$moreatt:'').'>';
$enabledisablehtml = '<span class="fa '.$fakey.' '.($marginleftonlyshort?'marginleftonlyshort':'marginleftonly').' valignmiddle'.($morecss?' '.$morecss:'').'" style="'.($fasize?('font-size: '.$fasize.';'):'').($facolor?(' color: '.$facolor.';'):'').'" alt="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'"'.($moreatt?' '.$moreatt:'').'>';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$enabledisablehtml.= $titlealt;
}

View File

@ -50,7 +50,9 @@ print '<table summary="listofattributes" class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td align="left">'.$langs->trans("Position");
print '<span class="nowrap"><img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow.png" alt="" title="A-Z" class="imgdown"></span>';
print '<span class="nowrap">';
print img_picto('A-Z', '1downarrow.png');
print '</span>';
print '</td>';
print '<td>'.$langs->trans("LabelOrTranslationKey").'</td>';
print '<td>'.$langs->trans("TranslationString").'</td>';

View File

@ -555,7 +555,7 @@ else
if (count($notavailable_choices)) {
print '<div id="AShowChoices">';
print '<img src="../theme/eldy/img/1downarrow.png"> <a href="#">'.$langs->trans('ShowNotAvailableOptions').'</a>';
print '<img src="../theme/eldy/img/1downarrow.png">';
print '</div>';
print '<div id="navail_choices" style="display:none">';

View File

@ -754,6 +754,9 @@ select.flat.selectlimit {
.marginleftonly {
margin-left: 10px !important;
}
.marginleftonlyshort {
margin-left: 4px !important;
}
.nomarginleft {
margin-left: 0px !important;
}

View File

@ -741,6 +741,9 @@ select.flat.selectlimit {
.marginleftonly {
margin-left: 10px !important;
}
.marginleftonlyshort {
margin-left: 4px !important;
}
.nomarginleft {
margin-left: 0px !important;
}