FormFile
class FormFile (View source)
Class to offer components to list and upload files
Properties
| string | $error | ||
| int | $numoffiles | ||
| array{nboffiles: int, extensions: array<string, int>, files: string[]} | $infofiles |
Methods
Constructor
Show an image with feature to edit it
Show form to upload a new file.
Show the box with list of available documents for object
Return a string to show the box with list of available documents for object.
Show a Document icon with link(s) You may want to call this into a div like this: print '
Show list of documents in $filearray (may be they are all in same directory but may not) This also sync database if $upload_dir is defined.
Show list of documents in a directory of ECM module.
Show array with linked files
Show detail icon with link for preview
Details
__construct($db)
Constructor
@param DoliDB $db Database handler
string
showImageToEdit(string $htmlname, string $modulepart, string $dirformainimage, string $subdirformainimage, string $fileformainimage)
Show an image with feature to edit it
form_attach_new_file($url, string $title = '', $addcancel = 0, int $sectionid = 0, $perm = 1, $size = 50, $object = null, $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', string $sectiondir = '', $usewithoutform = 0, $capture = 0, $disablemulti = 0, $nooutput = 0)
Show form to upload a new file.
@param string $url Url
show_documents($modulepart, string $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '')
Show the box with list of available documents for object
@param string $modulepart propal, facture, facture_fourn, ...
showdocuments(string $modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0, $removeaction = 'remove_file', $tooltipontemplatecombo = '')
Return a string to show the box with list of available documents for object.
This also set the property $this->numoffiles
string
getDocumentsLink(string $modulepart, string $modulesubdir, string $filedir, $filter = '', $morecss = 'valignmiddle', $allfiles = 0)
Show a Document icon with link(s) You may want to call this into a div like this: print '
list_of_documents(array<array{name: string, path: string, level1name: string, relativename: string, fullname: string, date: string, size: int, perm: int, type: string}> $filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0, $disablecrop = -1, $moreattrondiv = '', $moreoptions = array())
Show list of documents in $filearray (may be they are all in same directory but may not) This also sync database if $upload_dir is defined.
list_of_autoecmfiles($upload_dir, array<array{name: string, path: string, level1name: string, relativename: string, fullname: string, date: string, size: int, perm: int, type: string}> $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permissiontodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0)
Show list of documents in a directory of ECM module.
@param string $upload_dir Directory that was scanned. This directory will contains files into subdirs REF/files
int
listOfLinks(CommonObject $object, int<0, 1> $permissiontodelete = 1, ?string $action = null, ?string $selected = null, string $param = '', string $htmlname = 'formaddlink', array<string, mixed> $moreoptions = array())
Show array with linked files
string
showPreview(array{name: string, path?: string, level1name?: string, relativename?: string, fullname: string, date?: string, size?: int, perm?: int, type?: string} $file, string $modulepart, string $relativepath, int<min, 1> $ruleforpicto = 0, string $param = '')
Show detail icon with link for preview