From 5043aa7b3554073390b24e26c600f53af03fa35c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Feb 2019 12:17:11 +0100 Subject: [PATCH] Fix regression for icon of external menus --- htdocs/theme/eldy/main_menu_fa_icons.css | 6 +- htdocs/theme/eldy/style.css.php | 113 +++++++++++------------ 2 files changed, 59 insertions(+), 60 deletions(-) diff --git a/htdocs/theme/eldy/main_menu_fa_icons.css b/htdocs/theme/eldy/main_menu_fa_icons.css index 44cd7b99044..58890786111 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.css +++ b/htdocs/theme/eldy/main_menu_fa_icons.css @@ -49,7 +49,7 @@ div.mainmenu.cashdesk::before { div.mainmenu.takepos::before { font-family: "Font Awesome 5 Free"; font-weight: 900; - content: "\f788"; + content: "\f217"; color: white; font-size: 1.5em; } @@ -121,7 +121,7 @@ div.mainmenu.products::before { div.mainmenu.project::before { font-family: "Font Awesome 5 Free"; font-weight: 900; - content: "\f542"; + content: "\f0e8"; color: white; font-size: 1.5em; } @@ -145,7 +145,7 @@ div.mainmenu.tools::before { div.mainmenu.website::before { font-family: "Font Awesome 5 Free"; font-weight: 900; - content: "\f0e8"; + content: "\f542"; color: white; font-size: 1.5em; } \ No newline at end of file diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 556d7da8d87..7cb9c7c29b7 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1796,74 +1796,73 @@ a.tmenuimage { div.mainmenu.website { background-image: url(); } + - 'name of class for div') + 'name of class for div') - $moduletomainmenu=array( - 'user'=>'','syslog'=>'','societe'=>'companies','projet'=>'project','propale'=>'commercial','commande'=>'commercial', - 'produit'=>'products','service'=>'products','stock'=>'products', - 'don'=>'accountancy','tax'=>'accountancy','banque'=>'accountancy','facture'=>'accountancy','compta'=>'accountancy','accounting'=>'accountancy','adherent'=>'members','import'=>'tools','export'=>'tools','mailing'=>'tools', - 'contrat'=>'commercial','ficheinter'=>'commercial','ticket'=>'ticket','deplacement'=>'commercial', - 'fournisseur'=>'companies', - 'barcode'=>'','fckeditor'=>'','categorie'=>'', - ); - $mainmenuused='home'; - foreach($conf->modules as $val) + $moduletomainmenu=array( + 'user'=>'','syslog'=>'','societe'=>'companies','projet'=>'project','propale'=>'commercial','commande'=>'commercial', + 'produit'=>'products','service'=>'products','stock'=>'products', + 'don'=>'accountancy','tax'=>'accountancy','banque'=>'accountancy','facture'=>'accountancy','compta'=>'accountancy','accounting'=>'accountancy','adherent'=>'members','import'=>'tools','export'=>'tools','mailing'=>'tools', + 'contrat'=>'commercial','ficheinter'=>'commercial','ticket'=>'ticket','deplacement'=>'commercial', + 'fournisseur'=>'companies', + 'barcode'=>'','fckeditor'=>'','categorie'=>'', + ); + $mainmenuused='home'; + foreach($conf->modules as $val) + { + $mainmenuused.=','.(isset($moduletomainmenu[$val])?$moduletomainmenu[$val]:$val); + } + $mainmenuusedarray=array_unique(explode(',',$mainmenuused)); + + $generic=1; + // Put here list of menu entries when the div.mainmenu.menuentry was previously defined + $divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','takepos','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','website'); + // Put here list of menu entries we are sure we don't want + $divnotrequired=array('multicurrency','salaries','ticket','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition'); + foreach($mainmenuusedarray as $val) + { + if (empty($val) || in_array($val,$divalreadydefined)) continue; + if (in_array($val,$divnotrequired)) continue; + //print "XXX".$val; + + // Search img file in module dir + $found=0; $url=''; + foreach($conf->file->dol_document_root as $dirroot) { - $mainmenuused.=','.(isset($moduletomainmenu[$val])?$moduletomainmenu[$val]:$val); - } - $mainmenuusedarray=array_unique(explode(',',$mainmenuused)); - - $generic=1; - // Put here list of menu entries when the div.mainmenu.menuentry was previously defined - $divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','takepos','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','website'); - // Put here list of menu entries we are sure we don't want - $divnotrequired=array('multicurrency','salaries','ticket','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition'); - foreach($mainmenuusedarray as $val) - { - if (empty($val) || in_array($val,$divalreadydefined)) continue; - if (in_array($val,$divnotrequired)) continue; - //print "XXX".$val; - - // Search img file in module dir - $found=0; $url=''; - foreach($conf->file->dol_document_root as $dirroot) + if (file_exists($dirroot."/".$val."/img/".$val."_over.png")) { - if (file_exists($dirroot."/".$val."/img/".$val."_over.png")) - { - $url=dol_buildpath('/'.$val.'/img/'.$val.'_over.png', 1); - $found=1; - break; - } - } - // Img file not found - if (! $found) - { - $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.$generic."_over.png",1); + $url=dol_buildpath('/'.$val.'/img/'.$val.'_over.png', 1); $found=1; - if ($generic < 4) $generic++; - print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; - } - if ($found) - { - print "div.mainmenu.".$val." {\n"; - print " background-image: url(".$url.");\n"; - print "}\n"; + break; } } - $j=0; - while ($j++ < 4) + // Img file not found + if (! $found) { - $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.$j."_over.png",1); - print "div.mainmenu.generic".$j." {\n"; + $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.$generic."_over.png",1); + $found=1; + if ($generic < 4) $generic++; + print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; + } + if ($found) + { + print "div.mainmenu.".$val." {\n"; print " background-image: url(".$url.");\n"; print "}\n"; } - // End of part to add more div class css - ?> - - + } + $j=0; + while ($j++ < 4) + { + $url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.$j."_over.png",1); + print "div.mainmenu.generic".$j." {\n"; + print " background-image: url(".$url.");\n"; + print "}\n"; + } + // End of part to add more div class css + ?> .tmenuimage {