2
0
forked from Wavyzz/dolibarr

Use fontawesome for img_warning

This commit is contained in:
Laurent Destailleur
2019-10-09 17:33:46 +02:00
parent 16f44b0963
commit db651a607d
4 changed files with 15 additions and 9 deletions

View File

@@ -301,6 +301,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
$textwithnotags=preg_replace('/<([^>]+)>/i', '', $text); $textwithnotags=preg_replace('/<([^>]+)>/i', '', $text);
$text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; $text2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:'';
$text2withnotags=preg_replace('/<([^>]+)>/i', '', $text2); $text2withnotags=preg_replace('/<([^>]+)>/i', '', $text2);
$textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:''; $textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:'';
//$out.= "xxx $textwithnotags y"; //$out.= "xxx $textwithnotags y";
if (empty($contents[$i][$j]['tooltip'])) $contents[$i][$j]['tooltip']=""; if (empty($contents[$i][$j]['tooltip'])) $contents[$i][$j]['tooltip']="";
@@ -332,13 +333,13 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength'];
if ($maxlength) $textwithnotags=dol_trunc($textwithnotags, $maxlength); if ($maxlength) $textwithnotags=dol_trunc($textwithnotags, $maxlength);
if (preg_match('/^<img/i', $text) || preg_match('/^<div/i', $text) || ! empty($contents[$i][$j]['asis'])) $out.= $text; // show text with no html cleaning if (preg_match('/^<(img|div|span)/i', $text) || ! empty($contents[$i][$j]['asis'])) $out.= $text; // show text with no html cleaning
else $out.= $textwithnotags; // show text with html cleaning else $out.= $textwithnotags; // show text with html cleaning
// End Url // End Url
if (! empty($contents[$i][$j]['url'])) $out.= '</a>'; if (! empty($contents[$i][$j]['url'])) $out.= '</a>';
if (preg_match('/^<img/i', $text2) || preg_match('/^<div/i', $text2) || ! empty($contents[$i][$j]['asis2'])) $out.= $text2; // show text with no html cleaning if (preg_match('/^<(img|div|span)/i', $text2) || ! empty($contents[$i][$j]['asis2'])) $out.= $text2; // show text with no html cleaning
else $out.= $text2withnotags; // show text with html cleaning else $out.= $text2withnotags; // show text with html cleaning
if (! empty($textnoformat)) $out.= "\n".$textnoformat."\n"; if (! empty($textnoformat)) $out.= "\n".$textnoformat."\n";

View File

@@ -3036,23 +3036,27 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'jabber','skype','twitter','facebook','linkedin', 'jabber','skype','twitter','facebook','linkedin',
'chevron-left','chevron-right','chevron-down','chevron-top', 'chevron-left','chevron-right','chevron-down','chevron-top',
'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic', 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic',
'warning',
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
) )
)) { )) {
$fa='fas'; $fa='fas';
$fakey = $pictowithouttext; $fakey = $pictowithouttext;
$facolor = ''; $fasize = ''; $facolor = ''; $fasize = '';
$arrayconvpictotofa = array( $arrayconvpictotofa = array(
'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'project'=>'sitemap', 'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'project'=>'sitemap',
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open',
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'bookmark'=>'star', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'bookmark'=>'star',
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork', 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork',
'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', 'object_list'=>'list-alt','object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table',
'warning'=>'exclamation-triangle',
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt' 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt'
); );
if ($pictowithouttext == 'warning') {
if ($pictowithouttext == 'switch_off') { $facolor = '';
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
$marginleftonlyshort = 0;
} elseif ($pictowithouttext == 'switch_off') {
$facolor = '#999'; $facolor = '#999';
$fasize = '2em'; $fasize = '2em';
$fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext]; $fakey = 'fa-'.$arrayconvpictotofa[$pictowithouttext];
@@ -3174,7 +3178,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$moreatt=trim($moreatt); $moreatt=trim($moreatt);
$enabledisablehtml = '<span class="' . $fa . ' ' . $fakey . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? ' marginleftonlyshort' : ' marginleftonly') : ''); $enabledisablehtml = '<span class="' . $fa . ' ' . $fakey . ($marginleftonlyshort ? ($marginleftonlyshort == 1 ? ' marginleftonlyshort' : ' marginleftonly') : '');
$enabledisablehtml .= ' valignmiddle' . ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>'; $enabledisablehtml .= ($morecss ? ' ' . $morecss : '') . '" style="' . ($fasize ? ('font-size: ' . $fasize . ';') : '') . ($facolor ? (' color: ' . $facolor . ';') : '') . ($morestyle ? ' ' . $morestyle : '') . '"' . (($notitle || empty($titlealt)) ? '' : ' title="' . dol_escape_htmltag($titlealt) . '"') . ($moreatt ? ' ' . $moreatt : '') . '>';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$enabledisablehtml.= $titlealt; $enabledisablehtml.= $titlealt;
} }
@@ -3510,7 +3514,7 @@ function img_warning($titlealt = 'default', $moreatt = '', $morecss = 'pictowarn
if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); if ($titlealt == 'default') $titlealt = $langs->trans('Warning');
//return '<div class="imglatecoin">'.img_picto($titlealt, 'warning_white.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): '')).'</div>'; //return '<div class="imglatecoin">'.img_picto($titlealt, 'warning_white.png', 'class="pictowarning valignmiddle"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): '')).'</div>';
return img_picto($titlealt, 'warning.png', 'class="valignmiddle'.($morecss?' '.$morecss:'').'"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): '')); return img_picto($titlealt, 'warning.png', 'class="'.$morecss.'"'.($moreatt ? ($moreatt == '1' ? ' style="float: right"' : ' '.$moreatt): ''));
} }
/** /**

View File

@@ -1349,7 +1349,8 @@ div.nopadding {
padding-<?php echo $left; ?>: 3px; padding-<?php echo $left; ?>: 3px;
} }
.pictowarning { .pictowarning {
vertical-align: text-bottom; /* vertical-align: text-bottom; */
color: #9f4705;
} }
.pictomodule { .pictomodule {
width: 14px; width: 14px;

View File

@@ -70,7 +70,7 @@ $colorbackbody='255,255,255';
$colortexttitlenotab='110,80,20'; $colortexttitlenotab='110,80,20';
$colortexttitle='0,0,0'; $colortexttitle='0,0,0';
$colortext='0,0,0'; $colortext='0,0,0';
$colortextlink='10, 10, 100'; $colortextlink='10, 20, 120';
$fontsize='0.86em'; $fontsize='0.86em';
$fontsizesmaller='0.75em'; $fontsizesmaller='0.75em';
$topMenuFontSize='1.2em'; $topMenuFontSize='1.2em';