If upload is disabled, we see it
This commit is contained in:
parent
295d305a78
commit
e11b06bc5b
@ -57,51 +57,59 @@ class FormFile
|
|||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
if ($conf->upload != 0)
|
print "\n\n<!-- Start form attach new file -->\n";
|
||||||
|
|
||||||
|
if (! $titre) $titre=$langs->trans("AttachANewFile");
|
||||||
|
print_titre($titre);
|
||||||
|
|
||||||
|
print '<form name="userfile" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||||
|
print '<input type="hidden" name="section" value="'.$sectionid.'">';
|
||||||
|
|
||||||
|
print '<table width="100%" class="noborder">';
|
||||||
|
print '<tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
|
$max=$conf->upload; // En Kb
|
||||||
|
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
||||||
|
if (eregi('m$',$maxphp)) $maxphp=$maxphp*1024;
|
||||||
|
if (eregi('k$',$maxphp)) $maxphp=$maxphp;
|
||||||
|
// Now $max and $maxphp are in Kb
|
||||||
|
if ($maxphp > 0) $max=min($max,$maxphp);
|
||||||
|
|
||||||
|
if ($conf->upload > 0)
|
||||||
{
|
{
|
||||||
print "\n\n<!-- Start form attach new file -->\n";
|
print '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
|
||||||
|
}
|
||||||
|
print '<input class="flat" type="file" name="userfile" size="70"';
|
||||||
|
print (empty($conf->upload)?' disabled="true"':'');
|
||||||
|
print '>';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||||
|
print (empty($conf->upload)?' disabled="true"':'');
|
||||||
|
print '>';
|
||||||
|
|
||||||
if (! $titre) $titre=$langs->trans("AttachANewFile");
|
if ($addcancel)
|
||||||
print_titre($titre);
|
{
|
||||||
|
|
||||||
print '<form name="userfile" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
|
||||||
print '<input type="hidden" name="section" value="'.$sectionid.'">';
|
|
||||||
|
|
||||||
print '<table width="100%" class="noborder">';
|
|
||||||
print '<tr><td width="50%" valign="top">';
|
|
||||||
|
|
||||||
$max=$conf->upload; // En Kb
|
|
||||||
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
|
||||||
if (eregi('m$',$maxphp)) $maxphp=$maxphp*1024;
|
|
||||||
if (eregi('k$',$maxphp)) $maxphp=$maxphp;
|
|
||||||
// Now $max and $maxphp are in Kb
|
|
||||||
if ($maxphp > 0) $max=min($max,$maxphp);
|
|
||||||
|
|
||||||
if ($conf->upload > 0)
|
|
||||||
{
|
|
||||||
print '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
|
|
||||||
}
|
|
||||||
print '<input class="flat" type="file" name="userfile" size="70">';
|
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'">';
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
|
}
|
||||||
if ($addcancel)
|
|
||||||
{
|
|
||||||
print ' ';
|
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (! empty($conf->upload))
|
||||||
|
{
|
||||||
print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
|
print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
|
||||||
print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
||||||
print ')';
|
print ')';
|
||||||
print "</td></tr>";
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
if (empty($sectionid)) print '<br>';
|
|
||||||
|
|
||||||
print "\n<!-- End form attach new file -->\n\n";
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print ' ('.$langs->trans("UploadDisabled").')';
|
||||||
|
}
|
||||||
|
print "</td></tr>";
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
if (empty($sectionid)) print '<br>';
|
||||||
|
|
||||||
|
print "\n<!-- End form attach new file -->\n\n";
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -402,7 +410,7 @@ class FormFile
|
|||||||
$url=$_SERVER["PHP_SELF"];
|
$url=$_SERVER["PHP_SELF"];
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Document"),$_SERVER["PHP_SELF"],"name","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Documents2"),$_SERVER["PHP_SELF"],"name","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Size"),$_SERVER["PHP_SELF"],"size","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Size"),$_SERVER["PHP_SELF"],"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"date","",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"date","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
|
|||||||
@ -437,6 +437,8 @@ Canceled=Canceled
|
|||||||
YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary
|
YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary
|
||||||
Color=Color
|
Color=Color
|
||||||
Documents=Linked files
|
Documents=Linked files
|
||||||
|
Documents2=Documents
|
||||||
|
UploadDisabled=Upload disabled
|
||||||
MenuECM=Documents
|
MenuECM=Documents
|
||||||
MenuAWStats=AWStats
|
MenuAWStats=AWStats
|
||||||
MenuMembers=Members
|
MenuMembers=Members
|
||||||
|
|||||||
@ -422,6 +422,7 @@ TotalMan=Total
|
|||||||
YouCanChangeValuesForThisListFromDictionnarySetup=Puede cambiar estos valores en el menú configuración->diccionarios
|
YouCanChangeValuesForThisListFromDictionnarySetup=Puede cambiar estos valores en el menú configuración->diccionarios
|
||||||
Color=Color
|
Color=Color
|
||||||
Documents=Documentos
|
Documents=Documentos
|
||||||
|
Documents2=Documentos
|
||||||
MenuECM=Documentos
|
MenuECM=Documentos
|
||||||
MenuAWStats=AWStats
|
MenuAWStats=AWStats
|
||||||
MenuMembers=Members
|
MenuMembers=Members
|
||||||
|
|||||||
@ -436,6 +436,8 @@ Canceled=Annul
|
|||||||
YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires
|
YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires
|
||||||
Color=Couleur
|
Color=Couleur
|
||||||
Documents=Fichiers joints
|
Documents=Fichiers joints
|
||||||
|
Documents2=Documents
|
||||||
|
UploadDisabled=Transfert désactivé
|
||||||
MenuECM=Documents
|
MenuECM=Documents
|
||||||
MenuAWStats=AWStats
|
MenuAWStats=AWStats
|
||||||
MenuMembers=Adhérents
|
MenuMembers=Adhérents
|
||||||
|
|||||||
@ -428,6 +428,7 @@ TotalMan =Totale
|
|||||||
YouCanChangeValuesForThisListFromDictionnarySetup =È possibile modificare i valori di questo elenco dal menu di impostazione - Dizionario
|
YouCanChangeValuesForThisListFromDictionnarySetup =È possibile modificare i valori di questo elenco dal menu di impostazione - Dizionario
|
||||||
Color =Colore
|
Color =Colore
|
||||||
Documents =Documenti
|
Documents =Documenti
|
||||||
|
Documents2 =Documenti
|
||||||
MenuECM =Documenti
|
MenuECM =Documenti
|
||||||
MenuAWStats =AWStats
|
MenuAWStats =AWStats
|
||||||
MenuMembers =Membri
|
MenuMembers =Membri
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user