clean indent in theme directory

This commit is contained in:
Frédéric FRANCE 2019-10-26 21:11:36 +02:00
parent c8259ff380
commit 7f3f48be0f
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
3 changed files with 97 additions and 92 deletions

View File

@ -186,7 +186,7 @@
<!-- Check indent are done with spaces and with correct number --> <!-- Check indent are done with spaces and with correct number -->
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- TODO Enable this
<arg name="tab-width" value="4"/> <arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"> <rule ref="Generic.WhiteSpace.ScopeIndent">
<properties> <properties>
@ -194,7 +194,7 @@
<property name="tabIndent" value="true"/> <property name="tabIndent" value="true"/>
</properties> </properties>
</rule> </rule>
-->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" /> <rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />

View File

@ -555,7 +555,7 @@ div.divsearchfield {
<?php <?php
// Add a nowrap on smartphone, so long list of field used for filter are overflowed with clip // Add a nowrap on smartphone, so long list of field used for filter are overflowed with clip
if ($conf->browser->layout == 'phone') { if ($conf->browser->layout == 'phone') {
?> ?>
.divsearchfieldfilter { .divsearchfieldfilter {
white-space: nowrap; white-space: nowrap;
} }

View File

@ -1230,11 +1230,12 @@ td.showDragHandle {
display: block; display: block;
font-family: "RobotoDraft","Roboto",sans-serif; font-family: "RobotoDraft","Roboto",sans-serif;
left: 0; left: 0;
<?php if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> <?php
<?php } else { ?> if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
} else { ?>
position: fixed; position: fixed;
top: 50px; top: 50px;
<?php } ?> <?php } ?>
z-index: 90; z-index: 90;
-webkit-transform: translateZ(0); -webkit-transform: translateZ(0);
-moz-transform: translateZ(0); -moz-transform: translateZ(0);
@ -1259,12 +1260,14 @@ td.showDragHandle {
-moz-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); -moz-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
<?php if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> <?php
<?php } else { ?> if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
} else { ?>
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
<?php } ?> <?php }
<?php } ?> }
?>
} }
/* /*
@ -1315,11 +1318,12 @@ div.login_block {
} }
.side-nav { .side-nav {
<?php if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> <?php
<?php } else { ?> if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
} else { ?>
overflow-x: initial !important; overflow-x: initial !important;
overflow-y: scroll; overflow-y: scroll;
<?php } ?> <?php } ?>
display: block; display: block;
position: relative; position: relative;
@ -1363,11 +1367,12 @@ div.login_block {
z-index: 91; z-index: 91;
background: rgb(<?php echo $colorbackvmenu1; ?>); background: rgb(<?php echo $colorbackvmenu1; ?>);
border-right: 1px solid rgba(0,0,0,0.3); border-right: 1px solid rgba(0,0,0,0.3);
<?php if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> <?php
if (in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?>
top: 50px ! important; top: 50px ! important;
<?php } else { ?> <?php } else { ?>
top: 60px ! important; top: 60px ! important;
<?php } ?> <?php } ?>
} }
div.fiche { div.fiche {
margin-<?php print $left; ?>: 6px !important; margin-<?php print $left; ?>: 6px !important;
@ -1730,12 +1735,12 @@ li.tmenu, li.tmenusel {
vertical-align: bottom; vertical-align: bottom;
<?php if (empty($conf->global->MAIN_MENU_INVERT)) { ?> <?php if (empty($conf->global->MAIN_MENU_INVERT)) { ?>
float: <?php print $left; ?>; float: <?php print $left; ?>;
<?php if (! $disableimages) { ?> <?php if (! $disableimages) { ?>
height: <?php print $heightmenu; ?>px; height: <?php print $heightmenu; ?>px;
padding: 0px 0px 2px 0px; padding: 0px 0px 2px 0px;
<?php } else { ?> <?php } else { ?>
padding: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;
<?php } } ?> <?php } } ?>
position:relative; position:relative;
display: block; display: block;
margin: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;
@ -1756,9 +1761,9 @@ div.tmenuleft
margin-top: 0px; margin-top: 0px;
<?php if (empty($conf->dol_optimize_smallscreen)) { ?> <?php if (empty($conf->dol_optimize_smallscreen)) { ?>
width: 5px; width: 5px;
<?php if (! $disableimages) { ?> <?php if (! $disableimages) { ?>
height: <?php print $heightmenu+4; ?>px; height: <?php print $heightmenu+4; ?>px;
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
} }
div.tmenucenter div.tmenucenter
@ -1887,82 +1892,82 @@ div.mainmenu.website {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/externalsite.png', 1) ?>); background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/externalsite.png', 1) ?>);
} }
<?php <?php
// Add here more div for other menu entries. moduletomainmenu=array('module name'=>'name of class for div') // Add here more div for other menu entries. moduletomainmenu=array('module name'=>'name of class for div')
$moduletomainmenu=array( $moduletomainmenu=array(
'user'=>'','syslog'=>'','societe'=>'companies','projet'=>'project','propale'=>'commercial','commande'=>'commercial', 'user'=>'','syslog'=>'','societe'=>'companies','projet'=>'project','propale'=>'commercial','commande'=>'commercial',
'produit'=>'products','service'=>'products','stock'=>'products', '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', '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', 'contrat'=>'commercial','ficheinter'=>'commercial','ticket'=>'ticket','deplacement'=>'commercial',
'fournisseur'=>'companies', 'fournisseur'=>'companies',
'barcode'=>'','fckeditor'=>'','categorie'=>'', 'barcode'=>'',
); 'fckeditor'=>'',
$mainmenuused='home'; 'categorie'=>'',
foreach($conf->modules as $val) );
{ $mainmenuused='home';
$mainmenuused.=','.(isset($moduletomainmenu[$val])?$moduletomainmenu[$val]:$val); foreach($conf->modules as $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','mrp','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")) $mainmenuused.=','.(isset($moduletomainmenu[$val])?$moduletomainmenu[$val]:$val);
{ }
$url=dol_buildpath('/'.$val.'/img/'.$val.'_over.png', 1); $mainmenuusedarray=array_unique(explode(',', $mainmenuused));
$found=1;
break; $generic=1;
} // Put here list of menu entries when the div.mainmenu.menuentry was previously defined
elseif (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité $divalreadydefined=array('home','companies','products','mrp','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)
{ {
$url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); if (file_exists($dirroot."/".$val."/img/".$val."_over.png"))
$found=1; {
break; $url=dol_buildpath('/'.$val.'/img/'.$val.'_over.png', 1);
$found=1;
break;
}
elseif (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité
{
$url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1);
$found=1;
break;
}
}
// Img file not found
if (! $found)
{
if (! defined('DISABLE_FONT_AWSOME')) {
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";
print 'div.mainmenu.'.$val.'::before {
content: "\f249";
}';
}
else
{
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";
$url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1);
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print "}\n";
}
$generic++;
}
else
{
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print "}\n";
} }
} }
// Img file not found // End of part to add more div class css
if (! $found) } // End test if $dol_hide_topmenu ?>
{
if (! defined('DISABLE_FONT_AWSOME')) {
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";
print 'div.mainmenu.'.$val.'::before {
content: "\f249";
}';
}
else
{
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";
$url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1);
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print "}\n";
}
$generic++;
}
else
{
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print "}\n";
}
}
// End of part to add more div class css
?>
<?php } // End test if $dol_hide_topmenu ?>
.tmenuimage { .tmenuimage {
padding:0 0 0 0 !important; padding:0 0 0 0 !important;