Merge pull request #15331 from Ahuahuachi/develop
NEW Allow disable multiple file upload in form_attach_new_file method
This commit is contained in:
commit
310123fe33
@ -79,9 +79,10 @@ class FormFile
|
|||||||
* @param string $sectiondir If upload must be done inside a particular directory (if sectiondir defined, sectionid must not be)
|
* @param string $sectiondir If upload must be done inside a particular directory (if sectiondir defined, sectionid must not be)
|
||||||
* @param int $usewithoutform 0=Default, 1=Disable <form> and style to use in existing area
|
* @param int $usewithoutform 0=Default, 1=Disable <form> and style to use in existing area
|
||||||
* @param int $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept.
|
* @param int $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept.
|
||||||
|
* @param int $disablemulti 0=Default, 1=Disable multiple file upload
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0)
|
public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0, $disablemulti = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
@ -170,7 +171,7 @@ class FormFile
|
|||||||
|
|
||||||
$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
|
$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
|
||||||
//$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic') ? ' name="userfile"' : ' name="userfile[]" multiple');
|
//$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic') ? ' name="userfile"' : ' name="userfile[]" multiple');
|
||||||
$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD)) ? ' name="userfile"' : ' name="userfile[]" multiple');
|
$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple');
|
||||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : '');
|
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : '');
|
||||||
$out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""');
|
$out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""');
|
||||||
$out .= (!empty($capture) ? ' capture="capture"' : '');
|
$out .= (!empty($capture) ? ' capture="capture"' : '');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user