Fix cancel in media filemanager
This commit is contained in:
parent
51c578840c
commit
8023bc2fbb
@ -1270,6 +1270,7 @@ class FormFile
|
||||
{
|
||||
print '</a>';
|
||||
$section_dir = dirname(GETPOST('urlfile', 'alpha'));
|
||||
if (! preg_match('/\/$/', $section_dir)) $section_dir.='/';
|
||||
print '<input type="hidden" name="section_dir" value="'.$section_dir.'">';
|
||||
print '<input type="hidden" name="renamefilefrom" value="'.dol_escape_htmltag($file['name']).'">';
|
||||
print '<input type="text" name="renamefileto" class="quatrevingtpercent" value="'.dol_escape_htmltag($file['name']).'">';
|
||||
|
||||
@ -272,7 +272,11 @@ if (empty($backtourl))
|
||||
}
|
||||
elseif (in_array($modulepart, array('bank'))) $backtourl = DOL_URL_ROOT."/compta/bank/document.php?id=".$id.'&file='.urldecode($file);
|
||||
elseif (in_array($modulepart, array('mrp'))) $backtourl = DOL_URL_ROOT."/mrp/mo_document.php?id=".$id.'&file='.urldecode($file);
|
||||
elseif (in_array($modulepart, array('medias'))) $backtourl = DOL_URL_ROOT."/website/index.php?action=file_manager&website=".$website."&file=".urldecode($file).'&preopend=image';
|
||||
elseif (in_array($modulepart, array('medias'))) {
|
||||
$section_dir = dirname($file);
|
||||
if (! preg_match('/\/$/', $section_dir)) $section_dir.='/';
|
||||
$backtourl = DOL_URL_ROOT."/website/index.php?action=file_manager&website=".$website.'§ion_dir='.urlencode($section_dir);
|
||||
}
|
||||
// Generic case that should work for everybody else
|
||||
else $backtourl = DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($file);
|
||||
}
|
||||
|
||||
@ -321,10 +321,7 @@ if (GETPOST('refreshsite', 'alpha') || GETPOST('refreshsite.x', 'alpha') || GETP
|
||||
}
|
||||
if (GETPOST('refreshpage', 'alpha') && !in_array($action, array('updatecss'))) $action = 'preview';
|
||||
|
||||
if ($action == 'renamefile') {
|
||||
$action = 'file_manager'; // After actions_linkedfiles, if action were renamefile, we set it to 'file_manager'
|
||||
}
|
||||
if ($cancel && $action == 'file_manager') {
|
||||
if ($cancel && $action == 'renamefile') {
|
||||
$cancel = '';
|
||||
}
|
||||
|
||||
@ -346,6 +343,10 @@ if ($sortorder) $backtopage .= '&sortorder='.$sortorder;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
$backtopage = $savbacktopage;
|
||||
|
||||
if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; If action were renamefile, we set it to 'file_manager'
|
||||
$action = 'file_manager';
|
||||
}
|
||||
|
||||
if ($action == 'seteditinline')
|
||||
{
|
||||
dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1);
|
||||
@ -2423,8 +2424,7 @@ if (!GETPOST('hide_websitemenu'))
|
||||
|
||||
|
||||
// Toolbar for pages
|
||||
|
||||
if ($websitekey && $websitekey != '-1' && !in_array($action, array('editcss', 'editmenu', 'importsite', 'file_manager', 'replacesite', 'replacesiteconfirm')))
|
||||
if ($websitekey && $websitekey != '-1' && !in_array($action, array('editcss', 'editmenu', 'importsite', 'file_manager', 'replacesite', 'replacesiteconfirm')) && !$file_manager)
|
||||
{
|
||||
print '</div>'; // Close current websitebar to open a new one
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user