More font awesome picto instead of img

This commit is contained in:
Laurent Destailleur 2018-04-16 19:56:53 +02:00
parent 106fb87d0a
commit 1e0a660d24
5 changed files with 33 additions and 18 deletions

View File

@ -261,17 +261,17 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
{ {
$sublink=''; $sublink='';
if (! empty($head['sublink'])) $sublink.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?'':' target="'.$head['target'].'"').'>'; if (! empty($head['sublink'])) $sublink.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?'':' target="'.$head['target'].'"').'>';
if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="opacitymedium '.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
if (! empty($head['sublink'])) $sublink.= '</a>'; if (! empty($head['sublink'])) $sublink.= '</a>';
$out.= '<td class="nocellnopadd boxclose right nowraponall">'; $out.= '<td class="nocellnopadd boxclose right nowraponall">';
$out.=$sublink; $out.=$sublink;
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
$out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone cursormove"'); $out.= img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="opacitymedium boxhandle hideonsmartphone cursormove"');
$out.= img_picto($langs->trans("CloseBox",$this->box_id),'close_title','class="boxclose cursorpointer" rel="x:y" id="imgclose'.$this->box_id.'"'); $out.= img_picto($langs->trans("CloseBox",$this->box_id),'close_title','class="opacitymedium boxclose cursorpointer" rel="x:y" id="imgclose'.$this->box_id.'"');
$label=$head['text']; $label=$head['text'];
//if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; //if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
if (! empty($head['graph'])) $label.=' <span class="fa fa-bar-chart"></span>'; if (! empty($head['graph'])) $label.=' <span class="opacitymedium fa fa-bar-chart"></span>';
$out.= '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">'; $out.= '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';
$out.= '</td></tr></table>'; $out.= '</td></tr></table>';
} }

View File

@ -5908,7 +5908,7 @@ class Form
</a> </a>
<input type="hidden" class="'.$htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> <input type="hidden" class="'.$htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'">
</dt> </dt>
<dd class="dropowndd"> <dd class="dropdowndd">
<div class="multiselectcheckbox'.$htmlname.'"> <div class="multiselectcheckbox'.$htmlname.'">
<ul class="ul'.$htmlname.'"> <ul class="ul'.$htmlname.'">
'.$lis.' '.$lis.'
@ -6032,13 +6032,13 @@ class Form
foreach($object->linkedObjects as $objecttype => $objects) foreach($object->linkedObjects as $objecttype => $objects)
{ {
$tplpath = $element = $subelement = $objecttype; $tplpath = $element = $subelement = $objecttype;
// to display inport button on tpl // to display inport button on tpl
$showImportButton=false; $showImportButton=false;
if(!empty($compatibleImportElementsList) && in_array($element,$compatibleImportElementsList)){ if(!empty($compatibleImportElementsList) && in_array($element,$compatibleImportElementsList)){
$showImportButton=true; $showImportButton=true;
} }
if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs)) if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
{ {
$element = $regs[1]; $element = $regs[1];
@ -6098,7 +6098,7 @@ class Form
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
$noMoreLinkedObjectBlockAfter=1; $noMoreLinkedObjectBlockAfter=1;
} }
$res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); $res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
if ($res) if ($res)
{ {
@ -6114,13 +6114,13 @@ class Form
} }
print '</table>'; print '</table>';
if(!empty($compatibleImportElementsList)) if(!empty($compatibleImportElementsList))
{ {
$res=@include dol_buildpath('core/tpl/ajax/objectlinked_lineimport.tpl.php'); $res=@include dol_buildpath('core/tpl/ajax/objectlinked_lineimport.tpl.php');
} }
print '</div>'; print '</div>';
return $nbofdifferenttypes; return $nbofdifferenttypes;

View File

@ -3089,7 +3089,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto); $pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
if (empty($srconly) && in_array($pictowithoutext, array('bank', 'delete', 'edit', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'switch_off', 'switch_on', 'unlink', 'uparrow'))) { if (empty($srconly) && in_array($pictowithoutext, array(
'bank', 'close_title', 'delete', 'edit', 'filter', 'grip_title', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
'switch_off', 'switch_on', 'unlink', 'uparrow')
)) {
$fakey = $pictowithoutext; $fakey = $pictowithoutext;
$facolor = ''; $facolor = '';
$fasize = ''; $fasize = '';
@ -3115,6 +3118,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-bank'; $fakey = 'fa-bank';
$facolor = '#444'; $facolor = '#444';
} }
elseif ($pictowithoutext == 'close_title') {
$fakey = 'fa-window-close';
}
elseif ($pictowithoutext == 'delete') { elseif ($pictowithoutext == 'delete') {
$fakey = 'fa-trash'; $fakey = 'fa-trash';
$facolor = '#444'; $facolor = '#444';
@ -3123,6 +3129,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-pencil'; $fakey = 'fa-pencil';
$facolor = '#444'; $facolor = '#444';
} }
elseif ($pictowithoutext == 'filter') {
$fakey = 'fa-'.$pictowithoutext;
}
elseif ($pictowithoutext == 'grip_title') {
$fakey = 'fa-arrows';
}
elseif ($pictowithoutext == 'printer') { elseif ($pictowithoutext == 'printer') {
$fakey = 'fa-print'; $fakey = 'fa-print';
$fasize = '1.2em'; $fasize = '1.2em';

View File

@ -4841,6 +4841,9 @@ dl.dropdown {
display:inline-block; display:inline-block;
padding: 0 3px 2px 0; padding: 0 3px 2px 0;
} }
.dropdown span.value {
display:none;
}
.dropdown dd ul { .dropdown dd ul {
background-color: #FFF; background-color: #FFF;
border: 1px solid #888; border: 1px solid #888;
@ -4853,13 +4856,12 @@ dl.dropdown {
max-height: 264px; max-height: 264px;
overflow: auto; overflow: auto;
} }
.dropdown span.value {
display:none;
}
.dropdown dd ul li { .dropdown dd ul li {
white-space: nowrap; white-space: nowrap;
font-weight: normal; font-weight: normal;
padding: 2px; padding: 2px;
/* color: rgb(<?php print $colortext; ?>); */
color: #000;
} }
.dropdown dd ul li input[type="checkbox"] { .dropdown dd ul li input[type="checkbox"] {
margin-<?php echo $right; ?>: 3px; margin-<?php echo $right; ?>: 3px;

View File

@ -4744,6 +4744,9 @@ dl.dropdown {
display:inline-block; display:inline-block;
padding: 0 3px 2px 0; padding: 0 3px 2px 0;
} }
.dropdown span.value {
display:none;
}
.dropdown dd ul { .dropdown dd ul {
background-color: #FFF; background-color: #FFF;
border: 1px solid #888; border: 1px solid #888;
@ -4756,13 +4759,11 @@ dl.dropdown {
max-height: 264px; max-height: 264px;
overflow: auto; overflow: auto;
} }
.dropdown span.value {
display:none;
}
.dropdown dd ul li { .dropdown dd ul li {
white-space: nowrap; white-space: nowrap;
font-weight: normal; font-weight: normal;
padding: 2px; padding: 2px;
color: #000;
} }
.dropdown dd ul li input[type="checkbox"] { .dropdown dd ul li input[type="checkbox"] {
margin-right: 3px; margin-right: 3px;