Fix phpcs

This commit is contained in:
Laurent Destailleur 2023-06-10 14:25:07 +02:00
parent 1738b6ccf4
commit 00da14e095
4 changed files with 17 additions and 13 deletions

View file

@ -409,8 +409,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir)
*/
function dol_compare_file($a, $b)
{
global $sortorder;
global $sortfield;
global $sortorder, $sortfield;
$sortorder = strtoupper($sortorder);
@ -440,6 +439,8 @@ function dol_compare_file($a, $b)
}
return ($a->size < $b->size) ? $retup : $retdown;
}
return 0;
}

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Anthony Berton <bertonanthony@gmail.com>
/* Copyright (C) 2022-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Anthony Berton <bertonanthony@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -24,8 +24,6 @@
*/
/**
* Connect to FTP server
*
@ -153,6 +151,7 @@ function dol_ftp_close($connect_id)
return ftp_close($connect_id);
}
}
return true;
}
/**

View file

@ -569,10 +569,12 @@ function dolJSToSetRandomPassword($htmlname, $htmlnameofbutton = 'generate_token
{
global $conf;
$out = '';
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<!-- Js code to suggest a security key -->';
print '<script nonce="'.getNonce().'" type="text/javascript">';
print 'jQuery(document).ready(function () {
$out .= "\n".'<!-- Js code to suggest a security key -->';
$out .= '<script nonce="'.getNonce().'" type="text/javascript">';
$out .= 'jQuery(document).ready(function () {
jQuery("#'.dol_escape_js($htmlnameofbutton).'").click(function() {
var currenttoken = jQuery("meta[name=anti-csrf-currenttoken]").attr("content");
console.log("We click on the button '.dol_escape_js($htmlnameofbutton).' to suggest a key. anti-csrf-currentotken is "+currenttoken+". We will fill '.dol_escape_js($htmlname).'");
@ -589,6 +591,8 @@ function dolJSToSetRandomPassword($htmlname, $htmlnameofbutton = 'generate_token
});
});
});'."\n";
print '</script>';
$out .= '</script>';
}
return $out;
}

View file

@ -394,7 +394,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print $langs->trans("WarningThemeForcedTo", $conf->global->MAIN_FORCETHEME);
}
print '<table class="nobordernopadding" width="100%"><tr><td><div class="center">';
print '<table class="nobordernopadding centpercent"><tr><td><div class="center">';
$i = 0;
foreach ($dirthemes as $dir) {
@ -470,7 +470,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
}
//Dark mode
// Dark mode
if ($foruserprofile) {
//Nothing
} else {
@ -527,7 +527,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '<td colspan="'.($colspan - 1).'">';
if ($edit) {
//print ajax_constantonoff('THEME_TOPMENU_DISABLE_IMAGE', array(), null, 0, 0, 1);
print $form->selectarray('THEME_TOPMENU_DISABLE_IMAGE', $listoftopmenumodes, isset($conf->global->THEME_TOPMENU_DISABLE_IMAGE)?$conf->global->THEME_TOPMENU_DISABLE_IMAGE:0);
print $form->selectarray('THEME_TOPMENU_DISABLE_IMAGE', $listoftopmenumodes, isset($conf->global->THEME_TOPMENU_DISABLE_IMAGE)?$conf->global->THEME_TOPMENU_DISABLE_IMAGE:0, 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx maxwidth500');
} else {
$listoftopmenumodes[$conf->global->THEME_TOPMENU_DISABLE_IMAGE];
//print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE);