Add optional remove action for showDocuments
This commit is contained in:
parent
4ce41e158a
commit
91483fd560
@ -331,9 +331,10 @@ class FormFile
|
|||||||
* @param string $morepicto Add more HTML content into cell with picto
|
* @param string $morepicto Add more HTML content into cell with picto
|
||||||
* @param Object $object Object when method is called from an object card.
|
* @param Object $object Object when method is called from an object card.
|
||||||
* @param int $hideifempty Hide section of generated files if there is no file
|
* @param int $hideifempty Hide section of generated files if there is no file
|
||||||
|
* @param string $removeaction (optional) The action to remove a file
|
||||||
* @return string Output string with HTML array of documents (might be empty string)
|
* @return string Output string with HTML array of documents (might be empty string)
|
||||||
*/
|
*/
|
||||||
public function showdocuments($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)
|
public function showdocuments($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')
|
||||||
{
|
{
|
||||||
// Deprecation warning
|
// Deprecation warning
|
||||||
if (!empty($iconPDF)) {
|
if (!empty($iconPDF)) {
|
||||||
@ -859,7 +860,7 @@ class FormFile
|
|||||||
if ($delallowed)
|
if ($delallowed)
|
||||||
{
|
{
|
||||||
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
|
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
|
||||||
$out .= '<a href="'.$tmpurlsource.((strpos($tmpurlsource, '?') === false) ? '?' : '&').'action=remove_file&file='.urlencode($relativepath);
|
$out .= '<a href="'.$tmpurlsource.((strpos($tmpurlsource, '?') === false) ? '?' : '&').'action='.$removeaction.'&file='.urlencode($relativepath);
|
||||||
$out .= ($param ? '&'.$param : '');
|
$out .= ($param ? '&'.$param : '');
|
||||||
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
|
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
|
||||||
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
|
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user