From 7b3793c775ba7ab959e515734a680092dd4979b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2016 02:33:40 +0200 Subject: [PATCH] Fix W3C on FTP setup page --- htdocs/ftp/admin/ftpclient.php | 28 +++++++++++++++++----------- htdocs/ftp/index.php | 21 ++++++++++++++++----- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 6f71e964321..01ada4f3185 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -37,7 +37,12 @@ $lastftpentry=0; $action = GETPOST('action','alpha'); $entry = GETPOST('numero_entry','alpha'); -// Positionne la variable pour le nombre de rss externes + +/* + * Action + */ + +// Get value for $lastftpentry $sql ="select MAX(name) as name from ".MAIN_DB_PREFIX."const"; $sql.=" WHERE name like 'FTP_SERVER_%'"; $result=$db->query($sql); @@ -210,8 +215,6 @@ else '."\n"; - $sql ="select name, value, note from ".MAIN_DB_PREFIX."const"; $sql.=" WHERE name like 'FTP_SERVER_%'"; $sql.=" ORDER BY name"; @@ -235,9 +238,13 @@ else print "
"; print ''; + print ''; + + print ''."\n"; - print ""; - print ""; + print ''; + print '"; + print ''; print ""; $var=!$var; @@ -281,12 +288,14 @@ else print "trans("Modify")."\">"; print "   "; print "trans("Delete")."\">"; - print ""; print ""; print ""; + print '
".$langs->trans("FTP")." ".($idrss)."
'.$langs->trans("FTP")." ".($idrss)."
'; + print "
"; - + print '
'; + $i++; } } @@ -294,9 +303,6 @@ else { dol_print_error($db); } - - print ''; - } llxFooter(); diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index b3dc15125a5..4658e9d09ec 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2016 Laurent Destailleur * Copyright (C) 2008-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ * \file htdocs/ftp/index.php * \ingroup ftp * \brief Main page for FTP section area - * \author Laurent Destailleur */ require('../main.inc.php'); @@ -418,7 +417,6 @@ else if ($action == 'delete_section') { print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); - } print $langs->trans("Server").': '.$ftp_server.'
'; @@ -646,8 +644,21 @@ else } else { - $s_ftp_server='FTP_SERVER_1'; - if (empty($s_ftp_server)) + $foundsetup=false; + $MAXFTP=20; + $i=1; + while ($i <= $MAXFTP) + { + $paramkey='FTP_NAME_'.$i; + //print $paramkey; + if (! empty($conf->global->$paramkey)) + { + $foundsetup=true; + break; + } + $i++; + } + if (! $foundsetup) { print $langs->trans("SetupOfFTPClientModuleNotComplete"); }